Skip to content

worker: fix worker name with \0 #59214

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theanarkh
Copy link
Contributor

fix worker name with \0.

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. worker Issues and PRs related to Worker support. labels Jul 25, 2025
@theanarkh theanarkh force-pushed the fix_process_and_worker_name branch 2 times, most recently from 00dbad2 to 51aa926 Compare July 25, 2025 18:11
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.04%. Comparing base (049664b) to head (51aa926).
⚠️ Report is 68 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59214      +/-   ##
==========================================
- Coverage   90.06%   90.04%   -0.03%     
==========================================
  Files         645      648       +3     
  Lines      189130   191044    +1914     
  Branches    37094    37453     +359     
==========================================
+ Hits       170339   172021    +1682     
- Misses      11511    11646     +135     
- Partials     7280     7377      +97     
Files with missing lines Coverage Δ
src/api/environment.cc 77.12% <100.00%> (+0.30%) ⬆️
src/node.h 92.30% <ø> (ø)
src/node_worker.cc 83.87% <100.00%> (-0.71%) ⬇️

... and 81 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.

Environment* env,
ThreadId thread_id,
const char* url,
const std::string& name) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not?

Suggested change
const std::string& name) {
std::string_view name) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The type of name parameter has been defined as std::string& in many functions, so there are quite a few places that need to be modified.

@theanarkh theanarkh force-pushed the fix_process_and_worker_name branch from 51aa926 to 27bae56 Compare July 26, 2025 17:03
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

LGTM although I'd consider @anonrig's suggestion, std::string_view is the cleaner replacement for an API that currently takes a const char*

@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 27, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 27, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants