[CDRIVER-4781] Using socketTimeoutMS=-1 results in an error Created: 10/Nov/23 Updated: 04/Dec/23 Resolved: 13/Nov/23 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.24.0, 1.25.0 |
| Fix Version/s: | 1.26.0, 1.25.2 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Kevin Albertson | Assignee: | Ezra Chung |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
SummarySetting the URI option socketTimeoutMS=-1 results in an error in C driver 1.25.1 with the message: "timeout_msec value 4294967295 exceeds supported 32-bit range" Here is a test showing the issue:
In versions <1.24.0, it was not an error. The error check was added in 4294967295 is the result of casting -1 as a uint32_t. mongoc_cluster_t::sockettimeoutms is represented as a uint32_t. Proposal: support the value -1 (and possibly negative values) for backwards compatibility. Document use of negative values as deprecated. Background & MotivationThis impacted a customer setting connectTimeoutMS to -1. Refer: https://mongodb.slack.com/archives/C0V2T72R2/p1699631179298719 Open questions1. In versions <1.24.0 was -1 interpreted as "no timeout" or "use default timeout"?
But the 1.25.1 C driver documentation claims "0" means "apply the default":
|
| Comments |
| Comment by Githook User [ 15/Nov/23 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: |
| Comment by Githook User [ 15/Nov/23 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: |
| Comment by Githook User [ 14/Nov/23 ] |
|
Author: {'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}Message:
|
| Comment by Githook User [ 13/Nov/23 ] |
|
Author: {'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}Message:
|