Skip to content

Commit

Permalink
fix(server): ensure state is transitioned to closed on connect fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 5, 2019
1 parent ee0db01 commit a471707
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/core/sdam/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ function connectEventHandler(server) {
return function(err, conn) {
if (err) {
server.emit('error', new MongoNetworkError(err));

stateTransition(this, STATE_CLOSED);
server.emit('close');
return;
}
Expand Down

0 comments on commit a471707

Please sign in to comment.