Skip to content

Avoid memory leak with weakref, avoid race condition, log closures#17

Merged
the-glu merged 1 commit intoOrbitalize:fix_1407_v1from
BenjaminPelletier:fix_1407_v1
Apr 8, 2026
Merged

Avoid memory leak with weakref, avoid race condition, log closures#17
the-glu merged 1 commit intoOrbitalize:fix_1407_v1from
BenjaminPelletier:fix_1407_v1

Conversation

@BenjaminPelletier
Copy link
Copy Markdown

This suggestion implements my comments on 1408 plus a few additional things:

  • Avoids memory leak by using weakref in periodic closure check
  • Avoids race condition between closure and new request by adding _closure_lock
  • Informs user when automatic closure occurs via log message, including differentiating UTMClientSession instances with int ID
  • Increases keepalive period to just under max keepalive time likely used by external infrastructure

Tested in current state and verified a large number of sessions (90+) and closures. Tested cherrypicking 1411 and verified a smaller number of sessions and closures.

@BenjaminPelletier BenjaminPelletier marked this pull request as ready for review April 8, 2026 01:23
@the-glu the-glu merged commit c1df458 into Orbitalize:fix_1407_v1 Apr 8, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants