Skip to content

Conversation

ammario
Copy link
Member

@ammario ammario commented Apr 1, 2023

In the prior implementation, calls to DoChan would stack up because we
weren't updating lastCollectedAts until collectMetadata finished. This
wasn't a true leak, instead, it meant that there would be
up to ~ (collectionRuntime / baseInterval) outstanding goroutines. So, for
example, if sleep 60s was the metadata script there would be up to
60 goroutines waiting at peak.

The new implementation has a simplistic singeflight where calls to Do will immediately return instead of blocking.

@ammario ammario self-assigned this Apr 1, 2023
@ammario ammario requested a review from kylecarbs April 1, 2023 18:46
@ammario ammario enabled auto-merge (squash) April 1, 2023 18:46
@ammario ammario disabled auto-merge April 1, 2023 18:47
@ammario ammario enabled auto-merge (squash) April 1, 2023 18:50
In the prior implementation, calls to DoChan would stack up because we
weren't updating lastCollectedAts until collectMetadata finished. This
wasn't a true leak, instead, it meant that there would be
up to ~ (collectionRuntime / baseInterval) outstanding goroutines. So, for
example, if `sleep 60s` was the metadata script there would be up to
60 goroutines waiting at peak.
@ammario ammario merged commit 34debbf into main Apr 1, 2023
@ammario ammario deleted the agent-md-noleak branch April 1, 2023 21:34
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants