Skip to content

Commit 867d35e

Browse files
nbbeekenW-A-James
andcommitted
feat(NODE-5682): set maxTimeMS on commands and preempt I/O (#4174)
Co-authored-by: Warren James <[email protected]>
1 parent 7a12914 commit 867d35e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cmap/wire_protocol/on_data.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export function onData(
9090
// Adding event handlers
9191
emitter.on('data', eventHandler);
9292
emitter.on('error', errorHandler);
93+
// eslint-disable-next-line github/no-then
94+
timeoutContext?.timeoutForSocketRead?.then(undefined, errorHandler);
9395

9496
const timeoutForSocketRead = timeoutContext?.timeoutForSocketRead;
9597
timeoutForSocketRead?.throwIfExpired();

0 commit comments

Comments
 (0)