-
Notifications
You must be signed in to change notification settings - Fork 3
v5.8.1 proposal #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5.8.1 proposal #216
Conversation
* Fix profiler shutdown when isolate is terminated When an isolate is terminated abruptly (eg. by Worker.terminate()), the profiler is not stopped and not removed from the isolate->profiler map. This can lead to a crash. This commit adds a cleanup hook with `node::AddEnvironmentCleanupHook` that is called when the isolate is destroyed. The cleanup hook stops the profiler and removes it from the profiler map.
it('should not crash when worker is terminated', async function () { | ||
this.timeout(30000); | ||
const nruns = 5; | ||
const concurrentWorkers = 20; | ||
for (let i = 0; i < nruns; i++) { | ||
const workers = []; | ||
for (let j = 0; j < concurrentWorkers; j++) { | ||
const worker = new Worker('./out/test/worker2.js'); | ||
worker.postMessage('hello'); | ||
|
||
worker.on('message', () => { | ||
worker.terminate(); | ||
}); | ||
|
||
workers.push( | ||
new Promise<void>((resolve, reject) => { | ||
worker.on('exit', exitCode => { | ||
if (exitCode === 1) { | ||
resolve(); | ||
} else { | ||
reject(new Error('Worker exited with code 0')); | ||
} | ||
}); | ||
}) | ||
); | ||
} | ||
await Promise.all(workers); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall package sizeSelf size: 1.58 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | source-map | 0.7.4 | 226 kB | 226 kB | | pprof-format | 2.1.0 | 111.69 kB | 111.69 kB | | p-limit | 3.1.0 | 7.75 kB | 13.78 kB | | delay | 5.0.0 | 11.17 kB | 11.17 kB | | node-gyp-build | 3.9.0 | 8.81 kB | 8.81 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) to 6.0.2 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together. Updates `serialize-javascript` from 6.0.0 to 6.0.2 - [Release notes](https://github.com/yahoo/serialize-javascript/releases) - [Commits](yahoo/serialize-javascript@v6.0.0...v6.0.2) Updates `mocha` from 10.2.0 to 10.8.2 - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md) - [Commits](mochajs/mocha@v10.2.0...v10.8.2) --- updated-dependencies: - dependency-name: serialize-javascript dependency-type: indirect - dependency-name: mocha dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
BenchmarksBenchmark execution time: 2025-06-10 11:05:51 Comparing candidate commit 992bcdf in PR branch Found 2 performance improvements and 0 performance regressions! Performance is the same for 92 metrics, 26 unstable metrics. scenario:profiler-light-load-no-wall-profiler-18
scenario:profiler-light-load-with-wall-profiler-18
|
NOTE: this version could not be released, so it is superseded by 5.8.2 in #220