Skip to content

Commit 60412d6

Browse files
committed
rgw/kafka: make sure that destroy is called after connection is removed
in addition. the dtor calls "destroy()", so there is no need to call it explictly Fixes: https://tracker.ceph.com/issues/61540 Signed-off-by: Yuval Lifshitz <[email protected]>
1 parent 53a3ae7 commit 60412d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/rgw/rgw_kafka.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ struct connection_t {
100100
// fire all remaining callbacks (if not fired by rd_kafka_flush)
101101
std::for_each(callbacks.begin(), callbacks.end(), [this](auto& cb_tag) {
102102
cb_tag.cb(status);
103-
ldout(cct, 20) << "Kafka destroy: invoking callback with tag=" << cb_tag.tag << dendl;
103+
ldout(cct, 20) << "Kafka destroy: invoking callback with tag=" << cb_tag.tag <<
104+
" for: " << broker << dendl;
104105
});
105106
callbacks.clear();
106107
delivery_tag = 1;
108+
ldout(cct, 20) << "Kafka destroy: complete for: " << broker << dendl;
107109
}
108110

109111
bool is_ok() const {
@@ -459,7 +461,6 @@ class Manager {
459461
// Checking the connection idlesness
460462
if(conn->timestamp.sec() + max_idle_time < ceph_clock_now()) {
461463
ldout(conn->cct, 20) << "kafka run: deleting a connection due to idle behaviour: " << ceph_clock_now() << dendl;
462-
conn->destroy(STATUS_CONNECTION_IDLE);
463464
std::lock_guard lock(connections_lock);
464465
conn_it = connections.erase(conn_it);
465466
--connection_count; \

0 commit comments

Comments
 (0)