[JAVA-3400] Async server selection can take up to heartbeat frequency even when server becomes available sooner Created: 23/Aug/19  Updated: 28/Oct/23  Resolved: 03/Sep/19

Status: Closed
Project: Java Driver
Component/s: Async, Cluster Management
Affects Version/s: None
Fix Version/s: 3.11.1

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There is a logic error in BaseCluster#selectServerAsync implementation. If the WaitQueueHandler is about to or already awaiting the next phase with the full heartbeat frequency timeout (default of 10 seconds) and a new request arrive to select a currently unavailable server, the wait queue handler is not notified, and therefore won't wake immediately to try to force a connection to the requested server.



 Comments   
Comment by Githook User [ 10/Oct/19 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: Force wait queue handler to wake up every time a request is queue

JAVA-3400
Branch: 3.11.x
https://github.com/mongodb/mongo-java-driver/commit/9acf1017b9fc6aaf152308cb8aa6caf28fe6c63a

Comment by Githook User [ 03/Sep/19 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: Force wait queue handler to wake up every time a request is queue

JAVA-3400
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/bc65ce2cad67e41caf5bbac7a1e2af69a40b90da

Comment by Jeffrey Yemin [ 23/Aug/19 ]

I have a proposed fix for this now, moving to in progress

Generated at Thu Feb 08 08:59:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.