File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
driver-core/src/main/com/mongodb/internal/connection Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ protected synchronized void updateDescription(final ClusterDescription newDescri
255
255
}
256
256
257
257
description = newDescription ;
258
- phase . getAndSet ( new CountDownLatch ( 1 )). countDown ();
258
+ updatePhase ();
259
259
}
260
260
261
261
protected void fireChangeEvent (final ClusterDescriptionChangedEvent event ) {
@@ -267,6 +267,10 @@ public ClusterDescription getCurrentDescription() {
267
267
return description ;
268
268
}
269
269
270
+ private synchronized void updatePhase () {
271
+ phase .getAndSet (new CountDownLatch (1 )).countDown ();
272
+ }
273
+
270
274
private long getMaxWaitTimeNanos () {
271
275
if (settings .getServerSelectionTimeout (NANOSECONDS ) < 0 ) {
272
276
return Long .MAX_VALUE ;
@@ -463,6 +467,8 @@ private synchronized void notifyWaitQueueHandler(final ServerSelectionRequest re
463
467
waitQueueHandler = new Thread (new WaitQueueHandler (), "cluster-" + clusterId .getValue ());
464
468
waitQueueHandler .setDaemon (true );
465
469
waitQueueHandler .start ();
470
+ } else {
471
+ updatePhase ();
466
472
}
467
473
}
468
474
}
You can’t perform that action at this time.
0 commit comments