Skip to content

[benchmarker] Add virtual user cleanup - #1704

Open
BenjaminPelletier wants to merge 3 commits into
interuss:mainfrom
BenjaminPelletier:benchmarker-cleanup
Open

[benchmarker] Add virtual user cleanup#1704
BenjaminPelletier wants to merge 3 commits into
interuss:mainfrom
BenjaminPelletier:benchmarker-cleanup

Conversation

@BenjaminPelletier

@BenjaminPelletier BenjaminPelletier commented Sep 11, 2026

Copy link
Copy Markdown
Member

Currently, benchmarker's virtual users are likely to leave the workspace dirty as increasing contention results in more operations failing, including operations that would clean up previous resources. This isn't a problem for disposable environments, but it is a problem for more permanent environments.

This PR adds a cleanup action for virtual users which is invoked leisurely after the users' main workflows have completed, and implements SCD op intent deletion during cleanup for virtual users performing SCD. I'm expecting a future PR to add ISA deletion during cleanup for virtual users performing NetRID.

I think this will be important to make an adaptive search to find/characterize the maximum load more quickly because that will require reliably reducing the load after performance became unstable before continuing (presumably successfully) at a lower load.

scalability_curve

@BenjaminPelletier
BenjaminPelletier marked this pull request as ready for review September 11, 2026 15:32
try:
_, _, query = await self.user.run_sync_client_call(
dss_instance.delete_op_intent,
id=op_intent_id,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Above it's self.op_intent_refs[flight.id] = op_intent_ref and there is passed as id for op_intent, is it correct, instead of op_intent_ref.id ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wow, good catch -- the keys are definitely flight IDs rather than op intent IDs, so I'm going to have to look into how I was able to observe some op intents being successfully removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've fixed the ID confusion, but this issue still worries me. I ran single_s2_cell.jsonnet specifically to catch things like this and one of my points of verification was to note that I saw at least some messages like "FPU2_1's SCDHandler cleaned up 1 op intents" which I took to indicate that the cleanup code paths were being fully exercised. But, I don't see how I could have seen those messages before making the fix for this issue in 0685ec3 since there shouldn't have been any op intents with the IDs of flights. I'm attaching my console output for another run on ba28748 that also contains the expected "SCDHandler cleaned up N op intents" messages, but now I'm nervous I might not be interpreting that evidence correctly. Can you think of any way I could have seen that message before fixing this issue you pointed out, or must I be remembering wrong?

log.txt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you check in the report if the queries generated 404 or something else?

Because the code is treating those as success no? So a wrong ID won't be visible

https://github.com/interuss/monitoring/pull/1704/changes#diff-6e7bf782a66e05d9a2a08e95bc8b13093e3c765a8aa8feb5c908c3bc1b82f460R590

logger.info(f"Cleaning up {len(virtual_users)} virtual users...")
cleanup_start = datetime.now(UTC)
for virtual_user in virtual_users:
await virtual_user.cleanup()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit/question: one cleanup generating and error will prevent others ones to cleanup, is that on purpose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, I think generally unhandled exceptions anywhere in a program should be raised quickly and loudly. And exceptions should only be handled when we're confident normal program execution can continue in a correct and consistent manner despite the exception. If we don't know what exception happened in cleanup, I don't think we could know we can continue in a correct and consistent manner. A QueryError is caught and handled in the SCDHandler cleanup so that shouldn't be a factor.

@BenjaminPelletier
BenjaminPelletier marked this pull request as draft September 11, 2026 19:05
@BenjaminPelletier
BenjaminPelletier marked this pull request as ready for review September 12, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants