Backport of Fix alias check leak into release/1.13.x #14984
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
CheckAlias.run()
but there were only about a dozen services.PR Checklist
external facing docs updatedOverview of commits