Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ethmonitor temporary resource leak #120

Merged
merged 3 commits into from
Apr 16, 2024
Merged

fix: ethmonitor temporary resource leak #120

merged 3 commits into from
Apr 16, 2024

Conversation

marino39
Copy link
Contributor

@marino39 marino39 commented Apr 16, 2024

No description provided.

@@ -352,7 +351,7 @@ func (m *Monitor) listenNewHead() <-chan uint64 {
streamingErrorLastTime = time.Now()
goto reconnect

case <-blockTimer.C:
case <-time.After(3 * m.options.ExpectedBlockInterval):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would create an extra channel + timeout interrupt in each for loop iteration

I think let's stick to blockTimer -- and stop it on error / ctx done

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marino39 marino39 merged commit 7321126 into master Apr 16, 2024
4 checks passed
@marino39 marino39 deleted the fix-timer-leak branch April 16, 2024 13:58
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.

2 participants