]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: fix unittest_seastar_messenger failure
authorYingxin Cheng <yingxincheng@gmail.com>
Mon, 14 Jan 2019 02:30:28 +0000 (10:30 +0800)
committerYingxin Cheng <yingxincheng@gmail.com>
Tue, 15 Jan 2019 04:02:33 +0000 (12:02 +0800)
unittest_seastar_messenger is failed since updated the seastar repo.
std::system_error (error system:22, Invalid argument) will be raised
from `listener->accept()`, which will be re-raised and not be captured.

This fix is to print error logs for the unexpected exceptions in
`SocketMessenger::start()` and not raise them again.

Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
src/crimson/net/SocketMessenger.cc

index 9891d6191f49a39f6e68780c0fb597e0223b88de..6fe4932f3e93efec9569b2a258a63dafacd07274 100644 (file)
 
 using namespace ceph::net;
 
+namespace {
+  seastar::logger& logger() {
+    return ceph::get_logger(ceph_subsys_ms);
+  }
+}
+
 SocketMessenger::SocketMessenger(const entity_name_t& myname,
                                  const std::string& logic_name,
                                  uint32_t nonce)
@@ -70,7 +76,7 @@ seastar::future<> SocketMessenger::start(Dispatcher *disp)
       }).handle_exception_type([this] (const std::system_error& e) {
         // stop gracefully on connection_aborted
         if (e.code() != error::connection_aborted) {
-          throw e;
+          logger().error("{} unexpected error during accept: {}", *this, e);
         }
       });
   }