From: Adam C. Emerson Date: Wed, 26 Nov 2025 03:15:13 +0000 (-0500) Subject: neorados: Do not try to decode an empty response in notify X-Git-Tag: v20.2.2~26^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc77f82fd982ad29d1b1c611c0a30f47770a83e9;p=ceph.git neorados: Do not try to decode an empty response in notify The response can be empty on some errors. Attempting to decode an empty one loses the error value on valid errors. Also swallow any decode errors. Signed-off-by: Adam C. Emerson (cherry picked from commit 89134791c16a2332457cfea85321a07e9ff7ca87) Fixes: https://tracker.ceph.com/issues/76434 Signed-off-by: Adam C. Emerson --- diff --git a/src/neorados/RADOS.cc b/src/neorados/RADOS.cc index 6aeaddbf7df..ef27c0779c6 100644 --- a/src/neorados/RADOS.cc +++ b/src/neorados/RADOS.cc @@ -1731,11 +1731,16 @@ struct NotifyHandler : std::enable_shared_from_this { ceph_assert(c); bc::flat_map, buffer::list> reply_map; bc::flat_set> missed_set; - auto p = rbl.cbegin(); - decode(reply_map, p); - decode(missed_set, p); - asio::dispatch(asio::append(std::move(c), res, std::move(reply_map), - std::move(missed_set))); + if (rbl.length() > 0) try { + auto p = rbl.cbegin(); + decode(reply_map, p); + decode(missed_set, p); + } catch (const std::exception&) { + // Swallowing the decode error. + } + asio::dispatch( + asio::append( + std::move(c), res, std::move(reply_map), std::move(missed_set))); } } };