Skip to content

[v13] Always close completed app sessions#36887

Merged
rosstimothy merged 1 commit intobranch/v13from
tross/backport-36651/v13
Jan 19, 2024
Merged

[v13] Always close completed app sessions#36887
rosstimothy merged 1 commit intobranch/v13from
tross/backport-36651/v13

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

Backport #36651 to branch/v13

changelog: Ensure that any opened app session is always closed on completion

The previous use of gravitational/ttlmap with a fixed capacity led
to sessions leaking and never being closed if a spike of sessions
greater than the capcity occurred. The sessionChunkCache relied
on the expiry callback function set on the ttlmap to be called in
order to close the app session and release resources. However, if
an item was evicted from the ttlmap because the capacity had been
exceeded the expiry callback was fired.

Instead of increasing the capacity to a larger size the ttlmap was
replaced entirely by utils.FnCache. It offers equivalent
functionality while still being actively maintained. This also
allowed refactoring to remove the sessionChunkCache entirely since
the FnCache took care of most of the added functionality that the
ttlmap wrapper was providing.

Partially addressed #36541.
@rosstimothy rosstimothy force-pushed the tross/backport-36651/v13 branch from 9b598d9 to e7822c6 Compare January 18, 2024 20:35
@rosstimothy rosstimothy marked this pull request as ready for review January 18, 2024 20:48
@github-actions github-actions Bot requested review from tigrato and zmb3 January 18, 2024 20:49
@rosstimothy rosstimothy added this pull request to the merge queue Jan 19, 2024
Merged via the queue into branch/v13 with commit 561de77 Jan 19, 2024
@rosstimothy rosstimothy deleted the tross/backport-36651/v13 branch January 19, 2024 16:15
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants