fix: invoke flush callback when transport worker is unref'd - #2482
fix: invoke flush callback when transport worker is unref'd#2482Hashim1999164 wants to merge 1 commit into
Conversation
|
Thanks for jumping on this — the ref-during-flush approach is exactly right! One design question for the maintainers before this lands: the root cause Fixing it there — ref the worker while any callback is in
Not a blocker for this PR — just wanted to surface the alternative in case |
|
Thanks for the thread-stream perspective. Happy to keep this PR as the pino-side workaround if maintainers prefer shipping the fix here first, or reshape it if the preferred path is fixing ref/unref in |
Summary
logger.flush(cb)never got its completion message on an idle event loop.Fixes #2481
Test plan
npx borp --timeout 60000 test/transport/sync-false.test.js test/syncfalse.test.js test/exit.test.js test/transport/core.test.js(51 passed)node test/fixtures/transport-flush-idle.jsprintscallback-firedand exits 0