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 <nmordech@redhat.com>
(cherry picked from commit
49c9dad15e5d5c182a88c1d9e21707bd1f8ccaba)
}
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));
});
});