fix(simulation): let API-started runs exit naturally (--no-wait) - #784
Open
Xshunzi wants to merge 1 commit into
Open
fix(simulation): let API-started runs exit naturally (--no-wait)#784Xshunzi wants to merge 1 commit into
Xshunzi wants to merge 1 commit into
Conversation
SimulationRunner spawns simulation scripts without --no-wait, so wait_for_commands stays True and the process keeps the whole OASIS environment resident after the simulation finishes. Only an explicit POST /api/simulation/stop can end it. Add --no-wait to the spawn command; all three runners (twitter/reddit/parallel) support the flag and exit promptly after the main loop completes. Refs 666ghj#779
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.
Summary
SimulationRunner.start_simulationspawns the platform scripts without--no-wait, sowait_for_commandsstaysTrueand the subprocess keeps the whole OASIS environment resident after the simulation finishes. API-started runs only end via an explicitPOST /api/simulation/stop.This PR adds
--no-waitto the spawn command so processes exit naturally once the main loop completes.Changes
backend/app/services/simulation_runner.py: append--no-waitto the spawned command.Why it is safe
All three runners already support
--no-wait:run_twitter_simulation.py(wait_for_commands=not args.no_wait)run_reddit_simulation.py(same)run_parallel_simulation.py(same)The flag only changes post-completion behavior (process exits instead of idling forever); simulation output is unchanged.
Related
Refs #779 (reported there as a separate defect from the six config fields).
Test plan
--helpon each runner lists--no-wait.