Skip to content
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

Handle global max blocks semaphore properly #2860

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

ashmeenkaur
Copy link
Collaborator

@ashmeenkaur ashmeenkaur commented Jan 6, 2025

Description

we are creating at least 1 block for each inode even if we are out of global max blocks (tracked by globalMaxBlocksSem semaphore), but at the time of releasing blocks we are not checking if the semaphore was acquired. This leads to panic("semaphore: released more than held").
This PR fixes this panic by always creating the 1st block without checking globalMaxBlocks and now we don't release the semaphore for last block in blockpool.

Link to the issue in case of a bug fix.

b/385057665

Testing details

  1. Manual - NA
  2. Unit tests - Added
  3. Integration tests - NA

@ashmeenkaur ashmeenkaur marked this pull request as ready for review January 6, 2025 09:05
@ashmeenkaur ashmeenkaur requested a review from a team as a code owner January 6, 2025 09:05
@kislaykishore kislaykishore requested review from a team, tritone and BrennaEpp and removed request for a team and tritone January 6, 2025 09:05
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.10%. Comparing base (7a13c4a) to head (ad084e0).
Report is 36 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2860      +/-   ##
==========================================
- Coverage   76.15%   76.10%   -0.05%     
==========================================
  Files         118      118              
  Lines       16596    16604       +8     
==========================================
- Hits        12639    12637       -2     
- Misses       3425     3433       +8     
- Partials      532      534       +2     
Flag Coverage Δ
unittests 76.10% <100.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ashmeenkaur ashmeenkaur force-pushed the fix-global-block-semaphore branch from 783647d to ad1bfd3 Compare January 7, 2025 12:23
@ashmeenkaur ashmeenkaur merged commit 16b1e7d into master Jan 7, 2025
13 checks passed
@ashmeenkaur ashmeenkaur deleted the fix-global-block-semaphore branch January 7, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants