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

Reset connection pool on non-timeout network errors

      https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#network-error-when-reading-or-writing says:

      > The client SHOULD close all idle sockets in its connection pool for the server: if one socket is bad, it is likely that all are.

      This to me reads that, in the event of a non-timeout network error on (any) connection, all connections in that server's pool should be closed (which is easiest to achieve by bumping the pool's generation).

      Looking through rescue handlers for SocketError, I am not seeing code in the driver that would implement this behavior.

      It seems that https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#error-handling was not completely implemented either, specifically the bits about setting servers to unknown upon various node is recovering errors. This is currently done in the retryable writes module but it should be done in the per-operation error handler on a connection, so that even operations not subject to retryable writes get topology transitions done that are meant to result from not master/node is recovering errors.

            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: