fix(cloudxr): start runtime with spawn context - #263
Open
WilliamK112 wants to merge 1 commit into
Open
Conversation
Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
WilliamK112
force-pushed
the
codex/avoid-runtime-fork
branch
from
July 2, 2026 02:46
919a3a6 to
0004716
Compare
WilliamK112
marked this pull request as ready for review
July 2, 2026 02:48
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
spawnmultiprocessing context instead of the platform-default fork contextmultiprocessing.Processhandle shape so readiness polling andterminate_or_kill_runtimecleanup continue to work unchangedRationale
Issue #40 calls out that the current
multiprocessing.Process(target=runtime_run)path can fork from inside an already-running asyncio launcher. Usingspawnstarts the runtime in a fresh interpreter, avoiding inherited asyncio lock/signal-handler state, while keeping this patch small and avoiding a broader subprocess-handle refactor.Fixes #40
Validation
NVIDIA/xr-ai@ec4169aa3e3c8a57f1d7f59d3e2d97ad9163a8bbuv run pytest -v test_cloudxr_runtime_process.py(fromtests/) - 1 passeduv run pytest -v test_cloudxr_runtime_process.py test_launcher_cloudxr_env.py(fromtests/) - 24 passeduv run python -m py_compile ..\cloudxr-runtime\cloudxr_runtime\__main__.py test_cloudxr_runtime_process.py(fromtests/)uv tool run --from ruff==0.15.16 ruff check cloudxr-runtime\cloudxr_runtime\__main__.py tests\test_cloudxr_runtime_process.pygit diff --check origin/main..HEAD