[JAVA-825] if no server is up the mongo constructor just blocks Created: 06/May/13  Updated: 06/May/13  Resolved: 06/May/13

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 2.11.1
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Antoine Girbal Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The java driver now has many wait() around the code that blocks until a server is up.
For example:

    private synchronized ConnectionStatus getConnectionStatus() {
        if (connectionStatus == null) {
            try {
                wait(_mongo.getMongoOptions().getConnectTimeout());
            } catch (InterruptedException e) {
                throw new MongoInterruptedException("Interrupted while waiting for next update to dynamic status", e);
            }
        }
        return connectionStatus;
    }

This design is surprising because the driver did not block in older version.
This can prevent the app from starting up.



 Comments   
Comment by Antoine Girbal [ 06/May/13 ]

Looks like we rely on connectTimeout to stop blocking on those.
The default is 10s it seems.

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