]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/ProtocolV2: catch correct bad_alloc exception 41247/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 4 May 2021 13:50:05 +0000 (15:50 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 9 May 2021 10:10:55 +0000 (12:10 +0200)
We want buffer::bad_alloc, not std::bad_alloc.  Otheriwise, we end
up with a confusing error

  failed decoding of frame header: Bad allocation

from ProtocolV2::run_continuation(), printed after frame header is
successfully decoded.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 67bb6cf524975ea54d539c5b10ba83fa496a1ced)

src/msg/async/ProtocolV2.cc

index c7eb9874b120d007c58739c89b0f021cefd1f59e..4a237e744e634b728d8bb6a2099a1db909e7f7f1 100644 (file)
@@ -1161,7 +1161,7 @@ CtPtr ProtocolV2::read_frame_segment() {
   try {
     rx_buffer = buffer::ptr_node::create(buffer::create_aligned(
         onwire_len, align));
-  } catch (std::bad_alloc&) {
+  } catch (const ceph::buffer::bad_alloc&) {
     // Catching because of potential issues with satisfying alignment.
     ldout(cct, 1) << __func__ << " can't allocate aligned rx_buffer"
                   << " len=" << onwire_len