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

Avoid implicit conversion to long long in Counter64 and Atomic64Metric classes

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Service Arch
    • Service Arch 2024-02-19

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: