Skip to content

fix(blocking): wake producers waiting on capacity after Reset#49

Merged
adrianbrad merged 2 commits intomainfrom
fix/blocking-reset-wake-offerers
Apr 21, 2026
Merged

fix(blocking): wake producers waiting on capacity after Reset#49
adrianbrad merged 2 commits intomainfrom
fix/blocking-reset-wake-offerers

Conversation

@adrianbrad
Copy link
Copy Markdown
Owner

Summary

  • Reset can free capacity slots when it restores the (smaller) initial set. Without broadcasting notFullCond, goroutines in OfferWait stay stuck.
  • Adds failing test first (commit 1), then the one-line fix (commit 2).

Fixes #39

Test plan

  • go test -race -shuffle=on .
  • New test fails on main, passes with the fix.

Asserts that OfferWait returns after Reset frees capacity. Fails on
current main because Reset only broadcasts notEmptyCond, leaving
producers stuck on notFullCond.Wait().

Refs #39
Reset can free capacity slots when it restores the initial (smaller)
element set. Without broadcasting notFullCond, any goroutine blocked
in OfferWait stays stuck until another consumer runs.

Fixes #39
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aabd29a) to head (406a8f6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #49   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          442       443    +1     
=========================================
+ Hits           442       443    +1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adrianbrad adrianbrad merged commit 49889c4 into main Apr 21, 2026
10 checks passed
@adrianbrad adrianbrad deleted the fix/blocking-reset-wake-offerers branch April 21, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Blocking.Reset does not wake goroutines blocked on OfferWait

1 participant