We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74a7583 commit f099711Copy full SHA for f099711
1 file changed
driver-core/src/main/com/mongodb/internal/connection/DefaultServerMonitor.java
@@ -216,6 +216,18 @@ public void run() {
216
continue;
217
}
218
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
231
logStateChange(previousServerDescription, currentServerDescription);
232
sdamProvider.get().monitorUpdate(currentServerDescription);
233
0 commit comments