]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/kafka: remove potential race condition between creation and deletion of endpoint
authorYuval Lifshitz <ylifshit@redhat.com>
Thu, 18 May 2023 18:02:29 +0000 (18:02 +0000)
committerYuval Lifshitz <ylifshit@redhat.com>
Sun, 14 Jan 2024 10:16:01 +0000 (10:16 +0000)
Fixes: https://tracker.ceph.com/issues/61254
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
(cherry picked from commit bc013baccaef4a797e6b9b4bc90c93dc94dad49e)

Conflicts:
src/rgw/rgw_kafka.cc

src/rgw/rgw_kafka.cc

index 9b75c9d0885749b55d3278cb9e6a27bd7f7b22dd..829c9341091a323765f09ddeaa555d682da31c47 100644 (file)
@@ -423,6 +423,7 @@ private:
         // Checking the connection idlesness
         if(conn->timestamp.sec() + max_idle_time < ceph_clock_now()) {
           ldout(conn->cct, 20) << "Time for deleting a connection due to idle behaviour: " << ceph_clock_now() << dendl;
+          std::lock_guard lock(connections_lock);
           ERASE_AND_CONTINUE(conn_it, connections);
         }