worker,etw: only enable ETW on the main thread
The Windows ETW code is not written to be compatible with multi-threading,
and in particular it relies on global state like a single static
uv_async_t
. Adding that to multiple threads would corrupt the
corresponding loops' handle queues.
This addresses the flakiness of at least test-worker-exit-code
and
very likely other flaky tests that relate to Worker threads on Windows as well.
(I've marked the less-easy-to-reproduce flaky tests as likely fixed -- we can still re-open the issues if it turns they are still problematic.)
Fixes: https://github.com/nodejs/node/issues/25847 Fixes: https://github.com/nodejs/node/issues/25702 (likely) Fixes: https://github.com/nodejs/node/issues/24005 (likely) Fixes: https://github.com/nodejs/node/issues/23873 (likely)
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes (probably) -
commit message follows commit guidelines