mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 16:22:29 +00:00

It makes timers and other libuv handles fire intermittently after the
'exit' event, contrary to what the documentation states.
Regression introduced in commit aac79df
("src: use stack-allocated
Environment instances") from June last year that made the
`while (handle_cleanup_waiting_ != 0) uv_run(event_loop(), UV_RUN_ONCE)`
loop run unconditionally on exit because it merged CleanupHandles() into
the Environment destructor.
This change breaks parallel/test-async-wrap-throw-from-callback because
the async_wrap idle handle is no longer cleaned up, which I resolved
pragmatically by removing the test.
In all seriousness, it is being removed in the upcoming async_wrap
revamp - it doesn't make sense to sink a lot of time in it now.
Fixes: https://github.com/nodejs/node/issues/12322
PR-URL: https://github.com/nodejs/node/pull/12344
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 lines
193 B
JavaScript
8 lines
193 B
JavaScript
'use strict';
|
|
require('../common');
|
|
|
|
process.on('exit', () => {
|
|
setTimeout(process.abort, 0); // Should not run.
|
|
for (const start = Date.now(); Date.now() - start < 10; /* Empty. */);
|
|
});
|