Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 853bcfe

Browse files
vkarpov15mbroadst
authored andcommitted
fix(server): emit "first connect" error if initial connect fails due to ECONNREFUSED
1 parent 58bed9b commit 853bcfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/topologies/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ var eventHandler = function(self, event) {
421421

422422
// On first connect fail
423423
if (
424-
self.s.pool.state === 'disconnected' &&
424+
['disconnected', 'connecting'].indexOf(self.s.pool.state) !== -1 &&
425425
self.initialConnect &&
426426
['close', 'timeout', 'error', 'parseError'].indexOf(event) !== -1
427427
) {

0 commit comments

Comments
 (0)