From: Nitzan Mordechai Date: Mon, 15 Jul 2024 10:02:04 +0000 (+0000) Subject: mgr/client: validate connection before sending X-Git-Tag: v19.2.1~299^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7de2bc553add0599ce388cc6ef5467ad08cb232b;p=ceph.git 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) --- 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)); }); });