diff options
author | Ben Caimano <ben.caimano@mongodb.com> | 2019-10-28 20:09:47 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-28 20:09:47 +0000 |
commit | b2fcdb98a5866a1c12b26f3db728b815ad61008a (patch) | |
tree | a0c728416e5a8560174f1a36fe49a2f320e0d903 /src/mongo/transport | |
parent | 2d650759fa1fd27ed93646bbdf3a9aa51650e997 (diff) | |
download | mongo-b2fcdb98a5866a1c12b26f3db728b815ad61008a.tar.gz |
SERVER-44183 Failure to listen on an asio socket should be fatal
Diffstat (limited to 'src/mongo/transport')
-rw-r--r-- | src/mongo/transport/transport_layer_asio.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/transport/transport_layer_asio.cpp b/src/mongo/transport/transport_layer_asio.cpp index cdbdddf0b6b..2f91a6d52c5 100644 --- a/src/mongo/transport/transport_layer_asio.cpp +++ b/src/mongo/transport/transport_layer_asio.cpp @@ -785,7 +785,14 @@ Status TransportLayerASIO::start() { if (_listenerOptions.isIngress()) { for (auto& acceptor : _acceptors) { - acceptor.second.listen(serverGlobalParams.listenBacklog); + asio::error_code ec; + acceptor.second.listen(serverGlobalParams.listenBacklog, ec); + if (ec) { + severe() << "Error listening for new connections on " << acceptor.first << ": " + << ec.message(); + fassertFailed(31339); + } + _acceptConnection(acceptor.second); log() << "Listening on " << acceptor.first.getAddr(); } |