mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
fixed zkutil_test. [#METR-2807]
This commit is contained in:
parent
7d179c4294
commit
33a88e83ae
@ -121,8 +121,6 @@ public:
|
||||
Stat * stat = nullptr,
|
||||
WatchFuture * watch = nullptr);
|
||||
|
||||
void close();
|
||||
|
||||
/** Транзакционно выполняет несколько операций. При любой ошибке бросает исключение.
|
||||
*/
|
||||
OpResultsPtr multi(const Ops & ops);
|
||||
|
@ -409,9 +409,13 @@ void ZooKeeper::removeRecursive(const std::string & path)
|
||||
remove(path);
|
||||
}
|
||||
|
||||
void ZooKeeper::close()
|
||||
ZooKeeper::~ZooKeeper()
|
||||
{
|
||||
check(zookeeper_close(impl));
|
||||
int code = zookeeper_close(impl);
|
||||
if (code != ZOK)
|
||||
{
|
||||
LOG_ERROR(&Logger::get("~ZooKeeper"), "Failed to close ZooKeeper session: " << zerror(code));
|
||||
}
|
||||
|
||||
/// удаляем WatchWithPromise которые уже никогда не будут обработаны
|
||||
for (WatchWithPromise * watch : watch_store)
|
||||
@ -419,18 +423,6 @@ void ZooKeeper::close()
|
||||
watch_store.clear();
|
||||
}
|
||||
|
||||
ZooKeeper::~ZooKeeper()
|
||||
{
|
||||
try
|
||||
{
|
||||
close();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
LOG_ERROR(&Logger::get("~ZooKeeper"), "Failed to close ZooKeeper session");
|
||||
}
|
||||
}
|
||||
|
||||
ZooKeeperPtr ZooKeeper::startNewSession() const
|
||||
{
|
||||
return new ZooKeeper(hosts, sessionTimeoutMs, state_watch);
|
||||
|
@ -209,8 +209,6 @@ int main(int argc, char ** argv)
|
||||
std::cerr << "KeeperException: " << e.displayText() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
zk.close();
|
||||
}
|
||||
catch (zkutil::KeeperException & e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user