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

ConnectionPoolStats.totalCreated is not monotonic

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • ALL
    • N&O 2025-04-14, N&O 2025-04-28, N&O 2025-05-12
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The documentation for `ConnectionPoolStats.totalCreated` suggests that the metric can only monotonically increase, but this is not the case. When appending stats, the `ConnectionPool` iterates through the stats for each host and adds them to the `ConnectionPoolStats` fields. However, hosts that are idle will eventually timeout and shutdown meaning we delete the totalCreated stats along with it. This can cause unexpected drops to the totalCreated metric.

      We should keep a separate counter for created connections that have expired and add them to the ConnectionPoolStats after appending all the host stats.

            Assignee:
            joseph.prince@mongodb.com Joseph Prince
            Reporter:
            joseph.prince@mongodb.com Joseph Prince
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: