Skip to content

[v12] Always close completed app sessions#36888

Merged
rosstimothy merged 1 commit intobranch/v12from
tross/backport-36651/v12
Jan 19, 2024
Merged

[v12] Always close completed app sessions#36888
rosstimothy merged 1 commit intobranch/v12from
tross/backport-36651/v12

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

Backport #36651 to branch/v12

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/v12 branch from 3c6849b to 0164c4d 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:48
@rosstimothy rosstimothy added this pull request to the merge queue Jan 19, 2024
Merged via the queue into branch/v12 with commit 277a174 Jan 19, 2024
@rosstimothy rosstimothy deleted the tross/backport-36651/v12 branch January 19, 2024 16:13
@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