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

Add server diagnostics to connection classes

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.13.0.beta1
    • Affects Version/s: None
    • Component/s: Connections
    • None
    • Fully Compatible

      Currently in the driver exceptions that are a result of a server operation are meant to have diagnostics on them including the address of the server that the operation was executed on.

      This diagnostics is currently added in the operation layer. This was fine in driver versions prior to 2.11 where all connections were set up after an operation started to execute, but is insufficient in 2.11+ driver when connections can be created by the connection pool outside of the operation layer.

      This ticket covers moving the network error-related diagnostic addition to the connection layer. As part of this work all methods in the various Connection classes that call Socket methods will have the diagnostics added to them to add the connection's address to the exception's notes.

      Note that the connection's address is different from the socket's address - the latter is an IP address but the former can be a hostname or an IP address depending on how the client and/or replica set was configured.

      The existing server diagnostics in the operation layer used to cover network and OperationFailure errors. The OperationFailure part is going to remain in the operation layer because the connection layer is unaware of this failure mode. To avoid duplicating diagnostics, the diagnostics added in operation layer will going forward only cover OperationFailure errors - SocketError and SocketTimeoutError will be skipped since they are expected to be handled by the lower-level connection code.

      A lint check is also going to be added to the Error class via Notable module that would prevent duplicate notes from being added to exceptions.

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

              Created:
              Updated:
              Resolved: