File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
driver-core/src/main/com/mongodb/internal/connection Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,18 @@ public void run() {
216216 continue ;
217217 }
218218
219+ // For POLL mode, if we just established initial connection, do an immediate heartbeat
220+ boolean justConnected = previousServerDescription .getType () == UNKNOWN
221+ && currentServerDescription .getType () != UNKNOWN
222+ && !shouldStreamResponses
223+ && connection != null && !connection .isClosed ();
224+
225+ if (justConnected ) {
226+ // Do immediate heartbeat for newly connected server in POLL mode
227+ // to fire the ServerHeartbeatSucceededEvent
228+ continue ;
229+ }
230+
219231 logStateChange (previousServerDescription , currentServerDescription );
220232 sdamProvider .get ().monitorUpdate (currentServerDescription );
221233
You can’t perform that action at this time.
0 commit comments