[JAVA-3057] retryWrites URI option doesn't override MongoClientOptions Created: 19/Oct/18 Updated: 28/Oct/23 Resolved: 22/Oct/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Configuration |
| Affects Version/s: | None |
| Fix Version/s: | 3.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Pulo | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Case: | (copied to CRM) | ||||
| Backwards Compatibility: | Minor Change | ||||
| Description |
|
When .retryWrites(true) is specified in the MongoClientOptions builder, passing retryWrites=false in the connection string URI doesn't disable retryable writes. The bug appears to be that retryWrites are only set in the builder when retryWrites in the URI is set to true: https://github.com/mongodb/mongo-java-driver/blob/05d983e0e215a2e153129a5f61f81068329ff19a/driver-legacy/src/main/com/mongodb/MongoClientURI.java#L330
This code should instead set the builder retryWrites if retryWrites has been set at all in proxied (like how all the other options are handled), rather than only if it has been set to a true value. Update This bug manifests similarly if the application sets .retryWrites(true) is specified in the MongoClientOptions builder and doesn't specify retryWrites at all in the connection string. In this case the final value will be false rather than true. Note also that this manifests as a similar bug in the new com.mongodb.MongoClientSettings class, and should be fixed there as well. |
| Comments |
| Comment by Githook User [ 22/Oct/18 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: Only apply retryWrites/compressors from connection string if set
|