]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/ProtocolV2: catch correct bad_alloc exception 41246/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:05:16 +0000 (12:05 +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 381d42c3d0affb5ce9f4623c6f55d6ebd0c04e58..b8a805e91c7f191b8a1e5a37eced636df47ebea0 100644 (file)
@@ -1152,7 +1152,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