[CDRIVER-2232] Read preference allows int64_t maxStalenessSeconds but URI is limited to int32_t Created: 03/Aug/17  Updated: 04/Aug/17  Resolved: 04/Aug/17

Status: Closed
Project: C Driver
Component/s: uri
Affects Version/s: 1.6.3
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to PHPC-846 Throw if maxStalenessSeconds URI opti... Closed
is related to CDRIVER-1933 Make minimum value of maxStalenessSec... Closed

 Description   

When maxStalenessSeconds was reverted from a double to an integer and the 90 second limit was added (SPEC-786), the patch for CDRIVER-1933 reverted the read preference type to int64_t but URI parsing was changed to int32_t (with error reporting for 64-bit integers).

Was this intentional or an inadvertent inconsistency? The specification does not refer to any upper limit for the option, and schwerin's comment in SPEC-786 implies that a 64-bit value is perfectly valid.



 Comments   
Comment by Jeremy Mikola [ 04/Aug/17 ]

jesse: That works for me. The PHP driver already enforces a 32-bit limit when we parse the option through the URI options array and our ReadPreference constructor, so I will keep that in place and ensure we document it.

Comment by A. Jesse Jiryu Davis [ 04/Aug/17 ]

I propose closing this "wontfix". Fixing it will allow maxStalenessSeconds over 2 billion, which is 63 years, which doesn't seem useful. In exchange, it'll add some complexity to the URI parser, which currently benefits from the simplifying assumption that all numbers are int32.

Generated at Wed Feb 07 21:14:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.