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

chore(all): remove unneeded timer channel drains #3002

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Dec 12, 2022

Changes

😭 Sorry I've been wrong and annoying everyone with draining timer channels when stopping them...
Basically (duh) a channel is just like any other pointer, so if it goes out of scope it gets GC'd. There is no need to drain it, even if it's buffered, as long as it goes out of scope, it'll get GC'd. So that means timers don't need to have their channels drained. The only reason to drain them (the timer documentation isn't so clear on that) is to reset them, which we don't use at all in our codebase (except once where the timer already expired and was drained)

Tests

Issues

Primary Reviewer

dot/network/discovery.go Outdated Show resolved Hide resolved
@qdm12 qdm12 added the PR Easy label Dec 12, 2022
@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Merging #3002 (7761da5) into development (169a1e9) will increase coverage by 0.02%.
The diff coverage is 12.50%.

Additional details and impacted files
@@               Coverage Diff               @@
##           development    #3002      +/-   ##
===============================================
+ Coverage        51.86%   51.89%   +0.02%     
===============================================
  Files              219      219              
  Lines            27724    27704      -20     
===============================================
- Hits             14380    14376       -4     
+ Misses           12118    12104      -14     
+ Partials          1226     1224       -2     

@qdm12 qdm12 force-pushed the qdm12/no-unneeded-timer-drains branch from 5d9b09a to 7761da5 Compare January 9, 2023 13:22
@qdm12 qdm12 merged commit 604f4d4 into development Jan 9, 2023
@qdm12 qdm12 deleted the qdm12/no-unneeded-timer-drains branch January 9, 2023 15:18
Copy link

🎉 This PR is included in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants