Skip to content

Commit

Permalink
fix(mongos): disconnect proxies which are not mongos instances
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Oct 9, 2019
1 parent 37dbe49 commit ee53983
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/core/topologies/mongos.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ function handleInitialConnectEvent(self, event) {
self.s.logger.warn(f(message, _this.name));
}

// This is not a mongos proxy, remove it completely
// This is not a mongos proxy, destroy and remove it completely
_this.destroy(true);
removeProxyFrom(self.connectingProxies, _this);
// Emit the left event
self.emit('left', 'server', _this);
Expand Down Expand Up @@ -445,10 +446,9 @@ function connectProxies(self, servers) {
server.connect(self.s.connectOptions);
}, timeoutInterval);
}

// Start all the servers
while (servers.length > 0) {
connect(servers.shift(), timeoutInterval++);
}
servers.forEach(server => connect(server, timeoutInterval++));
}

function pickProxy(self, session) {
Expand Down

0 comments on commit ee53983

Please sign in to comment.