]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/librados_test_stub/TestMemCluster.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / test / librados_test_stub / TestMemCluster.cc
index f829dd52c4ef421b6a295c6240ceb9e9d311b55a..f0995788b0f275c9d12db2913dedce4830ca271f 100644 (file)
@@ -174,10 +174,13 @@ bool TestMemCluster::is_blocklisted(uint32_t nonce) const {
 }
 
 void TestMemCluster::blocklist(uint32_t nonce) {
-  m_watch_notify.blocklist(nonce);
+  {
+    std::lock_guard locker{m_lock};
+    m_blocklist.insert(nonce);
+  }
 
-  std::lock_guard locker{m_lock};
-  m_blocklist.insert(nonce);
+  // after blocklisting the client, disconnect and drop its watches
+  m_watch_notify.blocklist(nonce);
 }
 
 void TestMemCluster::transaction_start(const ObjectLocator& locator) {