-
Type: Sub-task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Use Case
As a CSOT developer,
I want a clearly defined timeout abstraction,
So that that timeout logic can be consolidated and easily reasoned about during the CSOT implementation.
User Impact
- n/a - refactor
Dependencies
- n/a
Unknowns
- n/a
Acceptance Criteria
Implementation Requirements
- Introduce a new class that extends from Promise
- Always rejects when the timeout expires
- Has properties that indicate start, end, is timed out, and remaining time
- If timeoutMS is provided to AbstractOperation create a timeout promise
- Introduce a new CSOT Error class
- Implement a type narrowing helper on the class
- Replace TimeoutController with Timeout in Topology.selectServer and ConnectionPool.checkOut
Testing Requirements
- Ensure all existing unit and integration tests pass.
- If timeoutMS is 0 the promise never rejects
Documentation Requirements
- n/a
Follow Up Requirements
- n/a