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

p2p: peerTracker.gc leaks time.Ticker due to missing defer ticker.Stop(); please integrate leak static analyzer #223

Open
odeke-em opened this issue Oct 22, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@odeke-em
Copy link

ticker := time.NewTicker(gcCycle)

leaks the ticker due to a missing defer ticker.Stop() For an efficient p2p mechanism, let’s ensure that we gut out noise and RAM consumers like this. I’d suggest integrating static analyzers in the workflow and CI process. At Orijtech Inc we built a bunch of tools at https://cyber.orijtech.com/tools but for this case we produced tickeryzer https://medium.com/orijtech-developers/tickeryzer-static-analyzer-to-report-missing-time-ticker-stop-call-which-causes-resource-leak-2060a617a830

Kindly cc-ing @Wondertan @walldiss @liamsi

@Wondertan
Copy link
Member

Wondertan commented Oct 22, 2024

True. Luckily, it runs once per node instance for a lifetime of application without any practical leaking.

A simple good first contribution to the lib

@Wondertan Wondertan added the good first issue Good for newcomers label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants