]> git.apps.os.sepia.ceph.com Git - ceph-ci.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, 28 May 2023 16:07:25 +0000 (16:07 +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 ef647a601a3e30c56f84436b6ce005b0b1d4c351..cde0ea6200ec8f86ab9cc668043e87d5db3c664c 100644 (file)
@@ -476,6 +476,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);
         }