From 7de2bc553add0599ce388cc6ef5467ad08cb232b Mon Sep 17 00:00:00 2001 From: Nitzan Mordechai Date: Mon, 15 Jul 2024 10:02:04 +0000 Subject: [PATCH] mgr/client: validate connection before sending During the connection's lifecycle, it can be reset and set to nullptr by other functions. We need to verify that the connection is still available before attempting to send data. Fixes: https://tracker.ceph.com/issues/62162 Signed-off-by: NitzanMordhai (cherry picked from commit 49c9dad15e5d5c182a88c1d9e21707bd1f8ccaba) --- src/crimson/mgr/client.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/crimson/mgr/client.cc b/src/crimson/mgr/client.cc index d2a1ea5136a0..69a69bfddf55 100644 --- a/src/crimson/mgr/client.cc +++ b/src/crimson/mgr/client.cc @@ -165,6 +165,10 @@ void Client::report() } return with_stats.get_stats( ).then([this](auto &&pg_stats) { + if (!conn) { + logger().warn("report: no conn available; before sending stats, report skipped"); + return seastar::now(); + } return conn->send(std::move(pg_stats)); }); }); -- 2.47.3