Skip to content

src: fix live lock between environments with blocked requests - #65520

Open
IlyasShabi wants to merge 1 commit into
nodejs:mainfrom
IlyasShabi:ishabi/web-locks-livelock-62644
Open

src: fix live lock between environments with blocked requests#65520
IlyasShabi wants to merge 1 commit into
nodejs:mainfrom
IlyasShabi:ishabi/web-locks-livelock-62644

Conversation

@IlyasShabi

Copy link
Copy Markdown
Member

LockManager::ProcessQueue() woke every other env with any pending request, even when none of those requests could make progress. Two envs with requests blocked on the same resource would wake each other back and forth forever.

This PR will wake another env only when one of its requests can make progress:

  • the request is grantable or
  • it uses ifAvailable, which must run its callback with null when the resource is unavailable.

Fixes #62644

@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 Aug 24, 2026
Signed-off-by: ishabi <ilyasshabi94@gmail.com>
@IlyasShabi
IlyasShabi force-pushed the ishabi/web-locks-livelock-62644 branch from d979993 to 769b088 Compare August 24, 2026 17:43
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.15%. Comparing base (cb9bb66) to head (769b088).
⚠️ Report is 239 commits behind head on main.

Files with missing lines Patch % Lines
src/node_locks.cc 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65520      +/-   ##
==========================================
- Coverage   90.31%   90.15%   -0.17%     
==========================================
  Files         760      751       -9     
  Lines      248532   253587    +5055     
  Branches    46908    47781     +873     
==========================================
+ Hits       224467   228622    +4155     
- Misses      15505    16214     +709     
- Partials     8560     8751     +191     
Files with missing lines Coverage Δ
src/node_locks.cc 75.14% <50.00%> (+2.47%) ⬆️

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

locks.request live lock

2 participants