Skip to content

[v13] Reuse tunnel resolvers instead of creating one per connection attempt#37723

Merged
rosstimothy merged 1 commit intobranch/v13from
tross/backport-37566/v13
Feb 5, 2024
Merged

[v13] Reuse tunnel resolvers instead of creating one per connection attempt#37723
rosstimothy merged 1 commit intobranch/v13from
tross/backport-37566/v13

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Feb 2, 2024

Backport #37566 to branch/v13

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

…#37566)

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 force-pushed the tross/backport-37566/v13 branch from 40475e4 to 7269e33 Compare February 2, 2024 18:49
@rosstimothy rosstimothy marked this pull request as ready for review February 2, 2024 19:02
@github-actions github-actions Bot requested review from strideynet and zmb3 February 2, 2024 19:03
@github-actions github-actions Bot added machine-id size/sm tctl tctl - Teleport admin tool labels Feb 2, 2024
@rosstimothy
Copy link
Copy Markdown
Contributor Author

@strideynet I would appreciate a closer look at the tbot changes here.

@rosstimothy rosstimothy enabled auto-merge February 5, 2024 14:56
@rosstimothy rosstimothy added this pull request to the merge queue Feb 5, 2024
Merged via the queue into branch/v13 with commit 2e2cb48 Feb 5, 2024
@rosstimothy rosstimothy deleted the tross/backport-37566/v13 branch February 5, 2024 16:08
@camscale camscale mentioned this pull request Feb 6, 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.

3 participants