Merge pull request #26079 from ClickHouse/fix_abort

Fix abort in ZooKeeper client
This commit is contained in:
alesapin 2021-07-08 22:58:28 +03:00 committed by GitHub
commit c34a769143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -853,7 +853,8 @@ void ZooKeeper::finalize(bool error_send, bool error_receive)
}
/// Send thread will exit after sending close request or on expired flag
send_thread.join();
if (send_thread.joinable())
send_thread.join();
}
/// Set expired flag after we sent close event
@ -870,7 +871,7 @@ void ZooKeeper::finalize(bool error_send, bool error_receive)
tryLogCurrentException(__PRETTY_FUNCTION__);
}
if (!error_receive)
if (!error_receive && receive_thread.joinable())
receive_thread.join();
{