Skip to content

src: wake pending web locks when workers exit - #67305

Open
fatihguzeldev wants to merge 1 commit into
nodejs:mainfrom
fatihguzeldev:web-locks-worker-exit
Open

fatihguzeldev wants to merge 1 commit into
nodejs:mainfrom
fatihguzeldev:web-locks-worker-exit

Conversation

@fatihguzeldev

Copy link
Copy Markdown
Contributor

when a worker exits, its locks are removed but other requests can stay
pending until another lock request processes the queue.

wake remaining waiters during cleanup. reserve granted locks under the
queue mutex to prevent concurrent exclusive grants, and protect target
environments while queuing wakeups.

Fixes: #67216

wake requests left pending after worker cleanup. register granted locks
under the queue mutex to prevent concurrent exclusive grants, and
keep target environments alive until wakeups are queued.

add regression tests for worker exits and exclusive lock ownership.

Fixes: nodejs#67216
Signed-off-by: Fatih Güzel <fatihguzeldev@gmail.com>
@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. labels Nov 6, 2026
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.67%. Comparing base (9d8a9ad) to head (e91b6d2).

Files with missing lines Patch % Lines
src/node_locks.cc 84.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67305      +/-   ##
==========================================
- Coverage   90.69%   90.67%   -0.02%     
==========================================
  Files         797      797              
  Lines      279612   279622      +10     
  Branches    53789    53787       -2     
==========================================
- Hits       253584   253555      -29     
- Misses      16298    16341      +43     
+ Partials     9730     9726       -4     
Files with missing lines Coverage Δ
src/node_locks.cc 77.36% <84.00%> (+2.22%) ⬆️

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web Locks: a request waiting for a lock stays pending after the worker thread holding the lock exits

2 participants