fix(store): remove canceled height waiters - #3445
Conversation
Signed-off-by: luangucun <luangucun@outlook.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe height subscription now removes canceled waiter channels from its internal map. Tests cover repeated cancellation, independent waiters at the same height, and cancellation concurrent with ChangesHeight waiter cancellation cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change removes canceled internal waiters while preserving normal notification and cancellation behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3445 +/- ##
==========================================
+ Coverage 69.27% 69.41% +0.14%
==========================================
Files 121 121
Lines 11994 12010 +16
==========================================
+ Hits 8309 8337 +28
+ Misses 3685 3673 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Overview
Closes #3444
heightSub.Waitregisters a channel for every requested height, but the context-cancellation path did not unregister it. For heights that are never reached, canceled waiters remained referenced byheightChs, causing stale channels to accumulate during normal P2P sync cancellation and timeout lifecycles.This change:
heightMu;notifyUpTo;Tests:
go test ./pkg/storego test -race ./pkg/store -run 'TestHeightSubWaitCancellation' -count=10Summary by CodeRabbit
Bug Fixes
Tests