Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-73806

Avoid implicit conversion to long long in Counter64 and Atomic64Metric classes

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • Service Arch 2024-02-19

      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 SERVER-72815).

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            adi.zaimi@mongodb.com Adi Zaimi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: