Avoid busy loop in DDLWorker when ZooKeeper is not available [#CLICKHOUSE-4126]

This commit is contained in:
Alexey Milovidov 2018-11-10 20:52:25 +03:00
parent b21aa60e99
commit 8f50c62033

View File

@ -882,8 +882,12 @@ void DDLWorker::run()
catch (const Coordination::Exception & e)
{
if (!Coordination::isHardwareError(e.code))
throw;
throw; /// A logical error.
tryLogCurrentException(__PRETTY_FUNCTION__);
/// Avoid busy loop when ZooKeeper is not available.
::sleep(1);
}
}
catch (...)