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 |
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