Repository navigation
Launcher: retry the session replace/read on a Windows sharing violation - #61
Merged
Merged
Conversation
…lation (#60) On Windows os.replace (MoveFileEx) is refused while another process has the destination open, so a status poll or Urban Studio reading launcher-session.json at the moment the launcher wrote it made the background worker fail with WinError 5 and terminate the assets it had just started (seen intermittently in hakoniwalab/hakoniwa-urban-mobility#82). write_session's replace and read_session's read now retry PermissionError / WinError 5 and 32 every 50 ms for up to 2 s, on Windows only; POSIX and other errors are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #60.
Summary
os.replaceis refused while another process has the destination open. A status poll or Urban Studio readinglauncher-session.jsonat the moment the launcher wrote it made the background worker fail (WinError 5) and terminate the assets it had just started. It happened intermittently in the Urban Studio Windows portable verification (Urban Studio の Windows 持ち運べる版(portable) hakoniwa-urban-mobility#82).write_session's replace andread_session's read now retryPermissionError/ WinError 5 and 32 every 50 ms for up to 2 s, on Windows only. POSIX behaviour and other errors are unchanged.Test
tests/test_launcher_session_windows_sharing.py(5 tests):PYTHONPATH=src python -m pytest -q: 121 passed. Without the fix, the 5 new tests fail.🤖 Generated with Claude Code