fix: prevent ticker resource leak in chain tracker#2217
Open
nimrod-teich wants to merge 1 commit intomainfrom
Open
fix: prevent ticker resource leak in chain tracker#2217nimrod-teich wants to merge 1 commit intomainfrom
nimrod-teich wants to merge 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 10 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Fixed a resource leak where blockGapTicker was not being stopped when the chain tracker goroutine exits. Added defer statement to ensure the ticker is properly stopped when context is cancelled. Changes: - Added defer blockGapTicker.Stop() in chain_tracker.go start() method - Added TestChainTrackerTickerCleanup to verify proper cleanup on context cancellation - Added TestChainTrackerMultipleInstancesNoLeaks to test multiple instances lifecycle This ensures that when the chain tracker is stopped (via context cancellation), all resources including the ticker are properly released, preventing memory leaks in long-running applications.
96b5176 to
cafebf1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed a resource leak where blockGapTicker was not being stopped when the chain tracker goroutine exits. Added defer statement to ensure the ticker is properly stopped when context is cancelled.
Changes:
This ensures that when the chain tracker is stopped (via context cancellation), all resources including the ticker are properly released, preventing memory leaks in long-running applications.
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!in the type prefix if API or client breaking changemainbranchReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...