[uss_qualifier] Reduce number of UTMClientSessions generated by DSSInstanceResource and add timeout_seconds config option#1411
Merged
BenjaminPelletier merged 2 commits intointeruss:mainfrom Apr 8, 2026
Conversation
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.
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.
Sounds good; done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.