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

Enhance TimeoutError to represent server-side timeouts

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Ruby Drivers

      Per the CSOT spec (https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md#errors) – "external" timeouts (like server, network sockets, HTTP timeouts, etc) ought to be represented by the new TimeoutError class (but only when timeout_ms is present).

      I propose the following to implement this:

      • Refactor the behavior of OperationFailure (the current error class for server-side timeouts) into a module (e.g. OperationFailureBehavior).
      • Subclass TimeoutError with a new ServerTimeoutError, which implements this new OperationFailureBehavior module.
      • Change our error handling code so that it looks for OperationFailureBehavior instead of OperationFailure, allowing both operation failures and server timeouts to be handled by the current rescue handlers.
      • Allow an OperationFailure to be morphed into a ServerTimeoutError in such a way that the new error still accurately represents the original error, while also standing for a TimeoutError .
      • Ideally, we only use ServerTimeoutError when timeoutMS was provided to the original operation. To make this happen, we need to pass context to

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: