]> 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>
Thu, 18 May 2023 18:02:29 +0000 (18:02 +0000)
Fixes: https://tracker.ceph.com/issues/61254
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_kafka.cc

index 163b242d5c022063167b228ee9f656fd9bdb197b..b4c0ffa24cbb1f8e09b3837f5993066c18f214fa 100644 (file)
@@ -482,6 +482,7 @@ private:
         if(conn->timestamp.sec() + max_idle_time < ceph_clock_now()) {
           ldout(conn->cct, 20) << "kafka run: deleting a connection due to idle behaviour: " << ceph_clock_now() << dendl;
           conn->destroy(STATUS_CONNECTION_IDLE);
+          std::lock_guard lock(connections_lock);
           conn_it = connections.erase(conn_it);
           --connection_count; \
           continue;