]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/tools/store_nbd: handle ECONNABORTED returned by accept() 42303/head
authorKefu Chai <kchai@redhat.com>
Tue, 13 Jul 2021 11:42:19 +0000 (19:42 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 13 Jul 2021 11:43:42 +0000 (19:43 +0800)
if we abort accept() call, an ECONNABORTED is expected. and we should
handle it, otherwise unhandled exception will be noticed by seastar's
reactor. and it complains in that case.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/tools/store_nbd/store-nbd.cc

index e1ff3899db8fa07a18b747f4a971dbe0d4743a7a..5419c5565e10a77a366e5dca96da977cc5cc8762 100644 (file)
@@ -426,6 +426,11 @@ void NBDHandler::run()
               logger().error("NBDHandler::run saw exception {}", e);
             });
           });
+      }).handle_exception_type([] (const std::system_error &e) {
+        // an ECONNABORTED is expected when we are being stopped.
+        if (e.code() != std::errc::connection_aborted) {
+          logger().error("accept failed: {}", e);
+        }
       });
     });
   }).handle_exception_type([](const seastar::gate_closed_exception&) {});