transport: ignore errors during connection shutdown

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 <pdziepak@scylladb.com>
This commit is contained in:
Paweł Dziepak
2016-04-05 16:39:21 +01:00
parent 0d3d0a3c08
commit b00a3a76cc

View File

@@ -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() {