eth: cancel milestone subscriber on shutdown#2199
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
There was a problem hiding this comment.
Pull request overview
Fixes the Heimdall milestone WebSocket subscriber lifecycle so it shuts down cleanly when the Ethereum service stops, preventing post-shutdown DB writes and noisy reconnect/error logs.
Changes:
- Create a cancellable context for milestone WS subscriptions and cancel it when
s.closeChcloses. - Pass the cancellable context into
subscribeAndHandleMilestoneto ensure it exits on shutdown. - Update doc/comments around the milestone whitelist service and retry behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (12.50%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #2199 +/- ##
===========================================
+ Coverage 52.24% 52.28% +0.04%
===========================================
Files 884 884
Lines 155551 155557 +6
===========================================
+ Hits 81262 81329 +67
+ Misses 69055 68995 -60
+ Partials 5234 5233 -1
... and 22 files with indirect coverage changes
🚀 New features to boost your workflow:
|



Description
The Heimdall milestone WS subscriber in
startMilestoneWhitelistServicewas launched withcontext.Background(), so it kept running afterclose(s.closeCh)and outliveds.chainDb.Close().Logs:
After the fix, the subscriber returns as soon as closeCh closes, and none of the above appear post-shutdown.