From b00a3a76ccde44d3c1490c189059551d866e5ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Tue, 5 Apr 2016 16:39:21 +0100 Subject: [PATCH] transport: ignore errors during connection shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the other end of the connection has already disconnected the shutdown will fail with ENOTCONN. The resulting exception is going to propagate through the continuation chain that is supposed to shut the cql server down preventing it from properly waiting for all outstanding continuations. The solution is to just ignore any errors that shutdown() may return. Signed-off-by: Paweł Dziepak --- transport/server.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/transport/server.cc b/transport/server.cc index fe120e365f..b7c3f9e491 100644 --- a/transport/server.cc +++ b/transport/server.cc @@ -544,9 +544,12 @@ future<> cql_server::connection::process() future<> cql_server::connection::shutdown() { - return _fd.shutdown_input().then([this] { + return make_ready_future<>().then([this] { + return _fd.shutdown_input(); + }).then_wrapped([this] (auto&& f) { + f.ignore_ready_future(); return _fd.shutdown_output(); - }); + }).handle_exception([] (auto) {}); } future<> cql_server::connection::process_request() {