Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2298

Add server connection id to connection summaries/diagnostics

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Connections
    • None

      https://stackoverflow.com/questions/62687852/mongo-db-closed-connection-issue-from-springboot-client shows that the Java driver provides server connection id to clients:

       Closed connection [connectionId{localValue:7, serverValue:1381867}] to because the pool has been closed. org.mongodb.driver.connection Closed connection [connectionId{localValue:4, serverValue:1382308}] to because there was a socket exception raised by this connection.
      

      I checked ismaster and it appears to be the `connectionId` field:

      MongoDB Enterprise > db.runCommand({ismaster:1})
      {
      	"ismaster" : true,
      	"topologyVersion" : {
      		"processId" : ObjectId("5efd466aeb8ca26d40b472a8"),
      		"counter" : NumberLong(0)
      	},
      	"maxBsonObjectSize" : 16777216,
      	"maxMessageSizeBytes" : 48000000,
      	"maxWriteBatchSize" : 100000,
      	"localTime" : ISODate("2020-07-02T04:50:45.771Z"),
      	"logicalSessionTimeoutMinutes" : 30,
      	"connectionId" : 86,
      	"minWireVersion" : 0,
      	"maxWireVersion" : 9,
      	"readOnly" : false,
      	"ok" : 1
      }
      

      We should extract the server connection id and add it to our diagnostic output/summary information.

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: