[SERVER-81248] parseMaxTimeMS may narrow values of maxTimeMSOpOnly Created: 20/Sep/23 Updated: 03/Oct/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | James Harrison | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Operating System: | ALL |
| Participants: |
| Description |
|
When used to parse a field with the name maxTimeMSOpOnly, parseMaxTimeMS increases the max permitted value beyond INT_MAX. However, the returned value is of type int - the result will be narrowed long long -> int.
The justification for this leeway:
Given this, if maxTimeMS is provided INT_MAX, any maxTimeMSOpOnly derived from increasing this value slightly will be parsed as a very negative int value. The only use of this method on a field named maxTimeMSOpOnly identified so far is:
This compares > 0, so may treat this situation as if maxTimeMSOpOnly were 0 or unset. Given INT_MAX milliseconds is around 25 days, it's possible this has no real-world impact. |
|||||||||||||||||||||||||||||||||||||||||||||