diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2016-09-07 14:18:23 -0400 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2016-09-16 10:18:34 -0400 |
commit | e3b42fd990070f48c11b233cec0c198098d1a48f (patch) | |
tree | 464665d664b18fe709ccf5e9d039a424b9489a12 /src/mongo/util/net/sock.cpp | |
parent | 7693fa59c4470db729d85af99fb9cc3b264fa8c8 (diff) | |
download | mongo-e3b42fd990070f48c11b233cec0c198098d1a48f.tar.gz |
SERVER-26002 Make sure javascript sleep isn't interrupted
Diffstat (limited to 'src/mongo/util/net/sock.cpp')
-rw-r--r-- | src/mongo/util/net/sock.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index 9e172335663..8202c28d2fa 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -433,9 +433,7 @@ int Socket::_send(const char* data, int len, const char* context) { } #endif int ret = ::send(_fd, data, len, portSendFlags); - if (ret < 0) { - handleSendError(ret, context); - } + return ret; } @@ -449,11 +447,15 @@ void Socket::send(const char* data, int len, const char* context) { #else errno = ENETUNREACH; #endif - handleSendError(ret, context); } else { ret = _send(data, len, context); } + if (ret < 0) { + handleSendError(ret, context); + continue; + } + _bytesOut += ret; fassert(16507, ret <= len); @@ -594,7 +596,7 @@ void Socket::handleSendError(int ret, const char* context) { #endif LOG(_logLevel) << "Socket " << context << " send() timed out " << remoteString(); throw SocketException(SocketException::SEND_TIMEOUT, remoteString()); - } else { + } else if (mongo_errno != EINTR) { LOG(_logLevel) << "Socket " << context << " send() " << errnoWithDescription(mongo_errno) << ' ' << remoteString(); throw SocketException(SocketException::SEND_ERROR, remoteString()); @@ -614,7 +616,6 @@ void Socket::handleRecvError(int ret, int len) { int e = errno; #if defined(EINTR) if (e == EINTR) { - LOG(_logLevel) << "EINTR returned from recv(), retrying"; return; } #endif |