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

Invariant hit when connection refused from max_conns in gRPC

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch
    • Fully Compatible
    • ALL
    • Service Arch 2024-01-22

      Caught this while adapting max_conns_override.js to use gRPC metrics is the db is using gRPC to connect, which will go in with SERVER-84471.

      When we hit the max connections, startSession() returns without setting a termination status, and we hit an invariant in gRPC because the callback has returned without a termination status getting set.

      [js_test:max_conns_override] {"t":{"$date":"2024-01-12T19:02:26.493Z"},"s":"I""c":"NETWORK""id":8050201, "ctx":"js","msg":"Creating new connection","attr":{"hostAndPort":"127.0.0.1:20041","gRPC":true}}
      [js_test:max_conns_override] d20040| {"t":{"$date":"2024-01-12T19:02:26.495+00:00"},"s":"I""c":"NETWORK""id":22942,   "ctx":"thread29","msg":"Connection refused because there are too many open connections","attr":{"remote":"127.0.0.1:59188","connectionCount":5}}
      [js_test:max_conns_override] d20040| {"t":{"$date":"2024-01-12T19:02:26.497+00:00"},"s":"F""c":"ASSERT",   "id":23079,   "ctx":"thread29","msg":"Invariant failure","attr":{"expr":"status.has_value()","file":"src/mongo/transport/grpc/service.cpp","line":289}}
      [js_test:max_conns_override] d20040| {"t":{"$date":"2024-01-12T19:02:26.497+00:00"},"s":"F""c":"ASSERT",   "id":23080,   "ctx":"thread29","msg":"\n\n***aborting after invariant() failure\n\n"} 

            Assignee:
            erin.mcnulty@mongodb.com Erin McNulty
            Reporter:
            erin.mcnulty@mongodb.com Erin McNulty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: