diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2021-05-17 17:49:41 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-20 21:43:16 +0000 |
commit | 95f7b4c11c4aaff02b461b8f791dab1c7e61ef99 (patch) | |
tree | d533edc646237497ddc31934037db6620c0e548f /src/mongo/transport/session_asio.h | |
parent | 0dab95acc0d5dca595873bc94b8323e188f3b302 (diff) | |
download | mongo-95f7b4c11c4aaff02b461b8f791dab1c7e61ef99.tar.gz |
SERVER-56931 instrumentation for Asio setOption failures
Diffstat (limited to 'src/mongo/transport/session_asio.h')
-rw-r--r-- | src/mongo/transport/session_asio.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/transport/session_asio.h b/src/mongo/transport/session_asio.h index 8007aa3d781..a91e710f6f9 100644 --- a/src/mongo/transport/session_asio.h +++ b/src/mongo/transport/session_asio.h @@ -94,8 +94,8 @@ public: _isIngressSession(isIngressSession) { auto family = endpointToSockAddr(_socket.local_endpoint()).getType(); if (family == AF_INET || family == AF_INET6) { - _socket.set_option(asio::ip::tcp::no_delay(true)); - _socket.set_option(asio::socket_base::keep_alive(true)); + setSocketOption(_socket, asio::ip::tcp::no_delay(true), "session no delay"); + setSocketOption(_socket, asio::socket_base::keep_alive(true), "session keep alive"); setSocketKeepAliveParams(_socket.native_handle()); } @@ -357,12 +357,18 @@ protected: // Change boost::none (which means no timeout) into a zero value for the socket option, // which also means no timeout. auto timeout = _configuredTimeout.value_or(Milliseconds{0}); - getSocket().set_option(ASIOSocketTimeoutOption<SO_SNDTIMEO>(timeout), ec); + setSocketOption(getSocket(), + ASIOSocketTimeoutOption<SO_SNDTIMEO>(timeout), + ec, + "session send timeout"); if (auto status = errorCodeToStatus(ec); !status.isOK()) { tasserted(5342000, status.reason()); } - getSocket().set_option(ASIOSocketTimeoutOption<SO_RCVTIMEO>(timeout), ec); + setSocketOption(getSocket(), + ASIOSocketTimeoutOption<SO_RCVTIMEO>(timeout), + ec, + "session receive timeout"); if (auto status = errorCodeToStatus(ec); !status.isOK()) { tasserted(5342001, status.reason()); } |