Skip to content

worker: add diagnostic channel 'worker_threads.main.registry' - #67311

Open
ShogunPanda wants to merge 3 commits into
nodejs:mainfrom
ShogunPanda:threads-registry
Open

ShogunPanda wants to merge 3 commits into
nodejs:mainfrom
ShogunPanda:threads-registry

Conversation

@ShogunPanda

Copy link
Copy Markdown
Contributor

Summary

Add worker_threads.main.registry to expose changes to the worker messaging registry through diagnostics_channel.

Changes

  • Publish { threadIds } snapshots on registration and removal, including nested workers.
  • Emit exclusively on the main thread and allocate snapshots only when subscribers exist.
  • Document lifecycle limitations and cover registry updates, snapshot independence, and main-thread-only publication.

Notes

Registration does not guarantee readiness. Removal depends on the parent processing the worker's exit and can be delayed if the parent is blocked.

Additional Informations

AI-assisted work. All changes reviewed by a human.

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
Assisted-By: OpenAI:GPT-6.1 Sol <openai/gpt-6.1-sol>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. worker Issues and PRs related to the worker_threads module and Worker API. labels Nov 7, 2026
@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.74%. Comparing base (a43bfb5) to head (2858f5f).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67311      +/-   ##
==========================================
- Coverage   93.00%   90.74%   -2.27%     
==========================================
  Files         428      798     +370     
  Lines      195818   280004   +84186     
  Branches    30283    53852   +23569     
==========================================
+ Hits       182117   254077   +71960     
- Misses      13375    16236    +2861     
- Partials      326     9691    +9365     
Files with missing lines Coverage Δ
lib/internal/worker/messaging.js 100.00% <100.00%> (+1.65%) ⬆️

... and 522 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@ShogunPanda ShogunPanda added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. worker Issues and PRs related to the worker_threads module and Worker API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants