Skip to content

[uss_qualifier] Reduce number of UTMClientSessions generated by DSSInstanceResource and add timeout_seconds config option#1411

Merged
BenjaminPelletier merged 2 commits intointeruss:mainfrom
BenjaminPelletier:fewer-sessions
Apr 8, 2026
Merged

[uss_qualifier] Reduce number of UTMClientSessions generated by DSSInstanceResource and add timeout_seconds config option#1411
BenjaminPelletier merged 2 commits intointeruss:mainfrom
BenjaminPelletier:fewer-sessions

Conversation

@BenjaminPelletier
Copy link
Copy Markdown
Member

This discovery showed that DSSInstanceResource was creating a new UTMClientSession for each DSSInstance retrieved from it, and that generally occurred once for each test scenario instance. This resulted in more connections than allowed by the system (#1407) in certain test conditions.

This PR addresses this problem by having DSSInstanceResource reuse the same UTMClientSession for all DSSInstances spawned by that resource. The pattern of instantiating the UTMClientSession once in the resource constructor is also extended to the F3411 DSS resources, though this is stylistically-suggestive only and should not result in a change of behavior.

This PR also takes the opportunity to add a timeout_seconds configuration option to the F3548 DSS instance resource in case participants want to adjust that aspect of behavior. This configuration parameter is provided in the new instantiation location of the client.

@BenjaminPelletier BenjaminPelletier marked this pull request as ready for review April 7, 2026 22:53
the-glu pushed a commit to Orbitalize/monitoring that referenced this pull request Apr 8, 2026
This suggestion implements my comments on
[1408](interuss#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](interuss#1411) and verified a
smaller number of sessions and closures.
Copy link
Copy Markdown
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo:

  • Shouldn't this be rebased on top of #1413 though before merging to use the factory?
  • Update title to mention addition of timeout_seconds?

@BenjaminPelletier BenjaminPelletier changed the title [uss_qualifier] Reduce number of UTMClientSessions generated by DSSInstanceResource [uss_qualifier] Reduce number of UTMClientSessions generated by DSSInstanceResource and add timeout_seconds config option Apr 8, 2026
@BenjaminPelletier
Copy link
Copy Markdown
Member Author

Yes, either this one or #1413 will likely need to be adapted slightly if the other one is merged first, but I don't think that's too uncommon of a situation. Whichever one is easiest to achieve a passing review (turns out it's this one) will be merged first, and then the other one will be adapted to match before being merged.

  • Update title to mention addition of timeout_seconds?

Sounds good; done.

@BenjaminPelletier BenjaminPelletier merged commit acd5a7a into interuss:main Apr 8, 2026
22 checks passed
@BenjaminPelletier BenjaminPelletier deleted the fewer-sessions branch April 8, 2026 15:23
github-actions bot added a commit that referenced this pull request Apr 8, 2026
…stanceResource and add timeout_seconds config option (#1411) acd5a7a
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