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

[v15] Reuse tunnel resolvers instead of creating one per connection attempt #37718

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

rosstimothy
Copy link
Contributor

@rosstimothy rosstimothy commented Feb 2, 2024

Backport #37566 to branch/v15

changelog: Fixed memory leak in tbot caused by never closing reverse tunnel address resolvers

The `CachingResolver` is backed by a `FnCache` but does not expose
a way to close the underlying cache. This leads to memory leaks
as captured in #37025. Instead of modifying the resolver to allow
explicit cleanup to occur, the resolvers were refactored to be
created once per process instead of per connenction attempt to the
cluster. Since the cluster address is read from the config file, it
won't be changed for the duration of the process which allows us to
safely use a single resolver. The one potential downside to this
approach is the cache may return possibly stale errors during an
outage until the entry is TTLed.

Fixes #37025
@rosstimothy rosstimothy marked this pull request as ready for review February 2, 2024 17:57
@github-actions github-actions bot added backport machine-id size/sm tctl tctl - Teleport admin tool labels Feb 2, 2024
@rosstimothy rosstimothy added this pull request to the merge queue Feb 5, 2024
Merged via the queue into branch/v15 with commit c56d0ad Feb 5, 2024
37 checks passed
@rosstimothy rosstimothy deleted the bot/backport-37566-branch/v15 branch February 5, 2024 16:13
@camscale camscale mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants