Deno 2.6.5
macOS 26.2
Repro:
git clone https://github.com/lgarron/comlink && cd comlink
git checkout deno-unref-repro
npm install
npm run build
# This should return, but it hangs.
npx -- deno run --allow-read -- ./tests/portability/refCount-false.mjs
Uncomment and edit the amount of .unref() calls in tests/portability/refCount-false.mjs to observe that 4 total calls (including the initial) are not enough, but 5 are.
This contradicts the documentation:
https://nodejs.org/api/worker_threads.html#workerunref
Calling unref() on a worker allows the thread to exit if this is the only active handle in the event system. If the worker is already unref()ed calling unref() again has no effect.
This also reproduces using the default image for Codespaces (4 are not enough, but 5 are).
Deno 2.6.5
macOS 26.2
Repro:
Uncomment and edit the amount of
.unref()calls intests/portability/refCount-false.mjsto observe that 4 total calls (including the initial) are not enough, but 5 are.This contradicts the documentation:
https://nodejs.org/api/worker_threads.html#workerunref
This also reproduces using the default image for Codespaces (4 are not enough, but 5 are).