-
Type: Sub-task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Use Case
ModernConnection is just a copy of Connection, update it to use read/write async helpers. Notably, rework command monitoring due to the fact that it is bound to callback syntax at the moment.
User Impact
- None. The old Connection will still be used.
Dependencies
- No external dependencies
- Internally, ModernConnection class, async read/write functions, socket event handling
Unknowns
- How should we handle socket errors, closing, and timeouts?
- Using an AbortController that lives on the Connection class
- Is it a problem to reinterpret socketTimeoutMS as a total timeout of the read operation vs what it is now which is a timeout of idle-ness between chunks?
- No it is not a problem, but we ended up not needing to with the controller and signal approach to error handling.
Acceptance Criteria
Implementation Requirements
- Remove MessageStream and socket event handling from Connection ctor
- Except for 'close'. An idle connection in the ConnectionPool should clean it's self up if the socket closes.
- Change write(..., cb) call to the new async writeCommand
- Add a call to async read after the socket has been written to
- Perform parsing identical to the logic in onMessage
- Write error handling logic to be enabled before write and disabled after read
- Make use of AbortController to reject i/o promises
Testing Requirements
- Integration test
- Set an environment variable that makes the driver make connection pool connections with the new class
- newClient will set connectionType to ModernConnection
- Run a new typical linux suite (all versions, topologies, lb mode, serverApi)
Documentation Requirements
- None
Follow Up Requirements
- See parent for next subtasks