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

Retry reads on non-network errors e.g. cluster elections

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.6.2
    • Component/s: Public API

      We currently have the issue that when a primary switch occurs, our mongo operations raise Mongo::Error::OperationFailure: errmsg: "operation was interrupted" (11602). This exception causes the current operations to be aborted.

      Looking at https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/error/operation_failure.rb#L57 the message "operation was interrupted" is not listed in the RETRY_MESSAGES array.

      However, https://github.com/mongodb/mongo/blob/b7ff5816f4d9d468b1875013384e7e51184628a0/src/mongo/client/remote_command_retry_scheduler.cpp#L115 lists InterruptedDueToStepDown (which the error code 11602 maps to) as a retryable operation. Disclaimer: I didn't read much of the mongodb code, so the intention of the code may not be what I'm assuming it is.

      Can the operation error 11602 to added to the retryable errors in the ruby driver?

       

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

              Created:
              Updated:
              Resolved: