[JAVA-5183] toString() in ClusterSettings uses serverSelectionTimeoutMS to print the localThreshold value Created: 28/Sep/23  Updated: 28/Oct/23  Resolved: 28/Sep/23

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

Type: Bug Priority: Major - P3
Reporter: Dmitry Ryabtsev Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

This line is the problem:

557
    @Override
558
    public String toString() {
559
        return "{"
560
               + (hosts.isEmpty() ? "" : "hosts=" + hosts)
561
               + (srvHost == null ? "" : ", srvHost=" + srvHost)
562
               + (srvServiceName == null ? "" : ", srvServiceName=" + srvServiceName)
563
               + (srvMaxHosts == null ? "" : ", srvMaxHosts=" + srvMaxHosts)
564
               + ", mode=" + mode
565
               + ", requiredClusterType=" + requiredClusterType
566
               + ", requiredReplicaSetName='" + requiredReplicaSetName + '\''
567
               + ", serverSelector='" + serverSelector + '\''
568
               + ", clusterListeners='" + clusterListeners + '\''
569
               + ", serverSelectionTimeout='" + serverSelectionTimeoutMS + " ms" + '\''
570
               + ", localThreshold='" + serverSelectionTimeoutMS + " ms" + '\''
571
               + '}';
572
    }



 Comments   
Comment by Ross Lawley [ 28/Sep/23 ]

Many thanks dmitry.ryabtsev@mongodb.com

Comment by Githook User [ 28/Sep/23 ]

Author:

{'name': 'dryabtse', 'email': 'dryabtse@users.noreply.github.com', 'username': 'dryabtse'}

Message: Fixed ClusterSettings#toString

JAVA-5183
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/808ad6c78127caf40d04f38a3398b6f42cb7f790

Comment by Dmitry Ryabtsev [ 28/Sep/23 ]

PR: https://github.com/mongodb/mongo-java-driver/pull/1207/commits/c673457315f421b42ff13973f76f9128e429fab4

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