fix(node): avoid open handles for infinite delays#2669
Conversation
kettanaito
left a comment
There was a problem hiding this comment.
Oh wow, this looks extremely promising! Thank you for working on this, @FelmonFekadu. I left a few comments, please let me know what you think. Excited to get this merged, this has been one of the long-standing issues with infinite delays.
|
Addressed the review comments in b76a8a9. Changes: moved the child-process scenario into a dedicated fixture, extracted a shared hasRefCounted() helper reused by delay and ws, and reran the focused build/test/lint set. Verified with: pnpm build; pnpm exec vitest run src/core/delay.test.ts src/core/utils/internal/hasRefCounted.test.ts; pnpm exec vitest run --config=./test/node/vitest.config.ts test/node/msw-api/context/delay.node.test.ts; pnpm exec eslint src/core/delay.ts src/core/ws.ts src/core/delay.test.ts src/core/utils/internal/hasRefCounted.ts src/core/utils/internal/hasRefCounted.test.ts test/node/msw-api/context/delay.node.test.ts. |
|
@kettanaito Thanks for the review and the direction here. I addressed the inline comments in |
Released: v2.12.11 🎉This has been released in v2.12.11. Get these changes by running the following command: Predictable release automation by Release. |
Summary
delay('infinite')so it no longer keeps the event loop alive on its ownunref()behavior on infinite delaysserver.close()can exit cleanly after an infinite delay requestCloses #778.
Testing