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

Backport of Fix alias check leak into release/1.13.x #14984

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #14935 to be assessed for backporting due to the inclusion of the label backport/1.13.

The below text is copied from the body of the original PR.


Description

Preivously when alias check was removed it would not be stopped nor cleaned up from the associated aliasChecks map.

This means that any time an alias check was deregistered we would leak a goroutine for CheckAlias.run() because the stopCh would never be closed.

This issue comes up then the sidecar_service stanza is used, as documented here. When services are registered this way without custom health checks it leads to adding an alias check, which makes the sidecar service reflect the health of the underlying service.

The issue can lead to large goroutine counts in service mesh deployments on platforms where the client agent is mostly static but proxy services come and go regularly.

Testing & Reproduction steps

  • Noticed leak in a goroutine profile, which had over a thousand goroutines in CheckAlias.run() but there were only about a dozen services.
  • Confirmed behavior with the unit test added, which initially failed.

PR Checklist

  • updated test coverage
  • external facing docs updated
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core merged commit f9d5631 into release/1.13.x Oct 13, 2022
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/fix/alias-leak/implicitly-happy-katydid branch from 6a53e3a to 9927aa3 Compare October 13, 2022 22:31
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/fix/alias-leak/implicitly-happy-katydid branch October 13, 2022 22:31
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.

None yet

2 participants