Skip to content

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

Merged
merged 3 commits into from
Jun 12, 2025
Merged

v5.8.1 proposal #216

merged 3 commits into from
Jun 12, 2025

Conversation

szegedi
Copy link

@szegedi szegedi commented Jun 10, 2025

NOTE: this version could not be released, so it is superseded by 5.8.2 in #220

* 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.
@szegedi szegedi requested a review from nsavoire as a code owner June 10, 2025 10:38
Comment on lines +16 to +44
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);
}
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Quality Violation

Unexpected unnamed function. (...read more)

It is easier to debug your application code when you avoid anonymous functions so that the stack trace can show you meaningful error messages. This rule enforces all your function to be consistently declared with a name.

View in Datadog  Leave us feedback  Documentation

Copy link

github-actions bot commented Jun 10, 2025

Overall package size

Self size: 1.58 MB
Deduped: 1.95 MB
No deduping: 1.95 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

dependabot bot and others added 2 commits June 10, 2025 13:01
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>
@pr-commenter
Copy link

pr-commenter bot commented Jun 10, 2025

Benchmarks

Benchmark execution time: 2025-06-10 11:05:51

Comparing candidate commit 992bcdf in PR branch v5.8.1-proposal with baseline commit f7c31bf in branch v5.x.

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

  • 🟩 cpu_user_time [-6.875ms; -1.732ms] or [-7.572%; -1.908%]

scenario:profiler-light-load-with-wall-profiler-18

  • 🟩 cpu_user_time [-10.350ms; -1.805ms] or [-8.727%; -1.522%]

@szegedi szegedi merged commit 8f476f6 into v5.x Jun 12, 2025
56 checks passed
@szegedi szegedi deleted the v5.8.1-proposal branch June 12, 2025 07:09
@szegedi szegedi mentioned this pull request Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants