summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2013-09-05 15:29:42 -0400
committerDan Pasette <dan@mongodb.com>2013-10-02 17:44:01 -0400
commitbd96977507f3b45f2fafb3f8b8c3299948e5899c (patch)
treee48778928310aa951bfcb5c857b84b16303b0087
parentbd4653ca22ddeebd4bcdf074eb234a40843f8f3d (diff)
downloadmongo-bd96977507f3b45f2fafb3f8b8c3299948e5899c.tar.gz
SERVER-9109 continue rather than return on ECONNABORTED and EBADF
-rw-r--r--src/mongo/util/net/listen.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mongo/util/net/listen.cpp b/src/mongo/util/net/listen.cpp
index 4ba94d19c90..b92a3266a14 100644
--- a/src/mongo/util/net/listen.cpp
+++ b/src/mongo/util/net/listen.cpp
@@ -262,10 +262,14 @@ namespace mongo {
int s = accept(*it, from.raw(), &from.addressSize);
if ( s < 0 ) {
int x = errno; // so no global issues
- if ( x == ECONNABORTED || x == EBADF ) {
- log() << "Listener on port " << _port << " aborted" << endl;
+ if (x == EBADF) {
+ log() << "Port " << _port << " is no longer valid" << endl;
return;
}
+ else if (x == ECONNABORTED) {
+ log() << "Connection on port " << _port << " aborted" << endl;
+ continue;
+ }
if ( x == 0 && inShutdown() ) {
return; // socket closed
}
@@ -461,9 +465,13 @@ namespace mongo {
int s = accept(socks[eventIndex], from.raw(), &from.addressSize);
if ( s < 0 ) {
int x = errno; // so no global issues
- if ( x == ECONNABORTED || x == EBADF ) {
+ if (x == EBADF) {
+ log() << "Port " << _port << " is no longer valid" << endl;
+ continue;
+ }
+ else if (x == ECONNABORTED) {
log() << "Listener on port " << _port << " aborted" << endl;
- return;
+ continue;
}
if ( x == 0 && inShutdown() ) {
return; // socket closed