From: Yuval Lifshitz Date: Thu, 18 May 2023 18:02:29 +0000 (+0000) Subject: rgw/kafka: remove potential race condition between creation and deletion of endpoint X-Git-Tag: v18.1.2~55^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5e8d6460522b192c513de614ba71ac1dc1380e41;p=ceph-ci.git rgw/kafka: remove potential race condition between creation and deletion of endpoint Fixes: https://tracker.ceph.com/issues/61254 Signed-off-by: Yuval Lifshitz (cherry picked from commit bc013baccaef4a797e6b9b4bc90c93dc94dad49e) Conflicts: src/rgw/rgw_kafka.cc --- diff --git a/src/rgw/rgw_kafka.cc b/src/rgw/rgw_kafka.cc index ef647a601a3..cde0ea6200e 100644 --- a/src/rgw/rgw_kafka.cc +++ b/src/rgw/rgw_kafka.cc @@ -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); }