]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
neorados: Do not try to decode an empty response in notify
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 26 Nov 2025 03:15:13 +0000 (22:15 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 14 May 2026 23:17:47 +0000 (19:17 -0400)
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 <aemerson@redhat.com>
(cherry picked from commit 89134791c16a2332457cfea85321a07e9ff7ca87)
Fixes: https://tracker.ceph.com/issues/76434
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/neorados/RADOS.cc

index 6aeaddbf7df175e61f1f23669fffdee454b60040..ef27c0779c6990dfeeb88861130e14b652713971 100644 (file)
@@ -1731,11 +1731,16 @@ struct NotifyHandler : std::enable_shared_from_this<NotifyHandler> {
       ceph_assert(c);
       bc::flat_map<std::pair<uint64_t, uint64_t>, buffer::list> reply_map;
       bc::flat_set<std::pair<uint64_t, uint64_t>> 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)));
     }
   }
 };