-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
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