[SERVER-73806] Avoid implicit conversion to long long in Counter64 and Atomic64Metric classes Created: 09/Feb/23 Updated: 07/Feb/24 |
|
| Status: | Open |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Adi Zaimi | Assignee: | Billy Donahue |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Service Arch
|
||||||||
| Sprint: | Service Arch 2024-02-19 | ||||||||
| Participants: | |||||||||
| Description |
|
Counter64 and Atomic64Metric have an implicit conversion to long long which is risky. It may be preferred to have a more conventional extension mechanism for custom metrics specifically. With the way they are currently defined we can place Counter64 and Atomic64Metric in any BSON object and they're also usable in any function that accepts a long long, which feels very loose and not quite what we intend to allow by making these definitions. This came up while reviewing PR 9902 (of |
| Comments |
| Comment by Billy Donahue [ 07/Feb/24 ] |
|
Bringing this into SERVER-82303, which introduces traits that make the conversion unnecessary. |