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
255255 }
256256
257257 description = newDescription ;
258- phase . getAndSet ( new CountDownLatch ( 1 )). countDown ();
258+ updatePhase ();
259259 }
260260
261261 protected void fireChangeEvent (final ClusterDescriptionChangedEvent event ) {
@@ -267,6 +267,10 @@ public ClusterDescription getCurrentDescription() {
267267 return description ;
268268 }
269269
270+ private synchronized void updatePhase () {
271+ phase .getAndSet (new CountDownLatch (1 )).countDown ();
272+ }
273+
270274 private long getMaxWaitTimeNanos () {
271275 if (settings .getServerSelectionTimeout (NANOSECONDS ) < 0 ) {
272276 return Long .MAX_VALUE ;
@@ -463,6 +467,8 @@ private synchronized void notifyWaitQueueHandler(final ServerSelectionRequest re
463467 waitQueueHandler = new Thread (new WaitQueueHandler (), "cluster-" + clusterId .getValue ());
464468 waitQueueHandler .setDaemon (true );
465469 waitQueueHandler .start ();
470+ } else {
471+ updatePhase ();
466472 }
467473 }
468474 }
You can’t perform that action at this time.
0 commit comments