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: garbage collect node handlers #71

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

fix: garbage collect node handlers #71

wants to merge 3 commits into from

Conversation

iand
Copy link
Contributor

@iand iand commented Oct 25, 2023

Fixes a goroutine leak caused by not cleaning up idle node handlers. The map would grow to contain an entry and a corresponding work queue goroutine for every peer node ever contacted. This change keeps track of when a node handler was last used and removes ones that are deemed to be idle, cleaning up the goroutine at the same time.

Also reworks the network behaviour to follow the new behaviour notify/perform pattern and adds some configuration for logging and tracing.

Thunderdome testing shows goroutines remain steady with the fix and other resource utilization is the same or better.

Thunderdome test before fix: 10 reqs/sec

Thunderdome test after fix: 10 reqs/sec and 20 reqs/sec

@iand iand linked an issue Oct 25, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Cleanup idle NodeHandlers
1 participant