diff --git a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp index 0222dd1aed5..6d543b4af6b 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp +++ b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp @@ -997,8 +997,7 @@ void ZooKeeper::receiveEvent() void ZooKeeper::finalize(bool error_send, bool error_receive) { { - /// Will wait for pushRequest method. - std::unique_lock lock(expired_mutex); + std::unique_lock lock(push_request_mutex); if (expired) return; @@ -1350,7 +1349,7 @@ void ZooKeeper::pushRequest(RequestInfo && info) /// to avoid forgotten operations in the queue when session is expired. /// Invariant: when expired, no new operations will be pushed to the queue in 'pushRequest' /// and the queue will be drained in 'finalize'. - std::lock_guard lock(expired_mutex); + std::lock_guard lock(push_request_mutex); if (expired) throw Exception("Session expired", ZSESSIONEXPIRED); diff --git a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.h b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.h index 7b17b581403..170458e930f 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.h +++ b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.h @@ -573,7 +573,7 @@ private: std::atomic xid {1}; std::atomic expired {false}; - std::mutex expired_mutex; + std::mutex push_request_mutex; using clock = std::chrono::steady_clock;