node icon indicating copy to clipboard operation
node copied to clipboard

event loop regression after libuv v1.45.0 update

Open trevnorris opened this issue 1 year ago • 0 comments

Version

all

Platform

all

Subsystem

event loop

What steps will reproduce the bug?

// Backwards compatibility, this shouldn't run.
setTimeout(() => { throw new Error('bad') }, 1).unref();

const t = Date.now();
while (Date.now() - t < 10);

What do you see instead?

The test fails because of the change https://github.com/libuv/libuv/commit/66009549067cab59d697cd8df8091a179d1a15fc that landed in v1.45.0. What's happening is that unref'ing the timer shouldn't count as a handle internally, but the first iteration of timers runs regardless because the bootstrap takes longer than the timer's timeout.

Additional information

This was fixed in https://github.com/libuv/libuv/commit/24d1d0802d2c6ff6d0b2e556c0c2b1a5ebf33493, and should be included in the next libuv release. Node.js should update libuv as soon as is released (see https://github.com/libuv/libuv/issues/4060).

trevnorris avatar Jun 21 '23 16:06 trevnorris