Repository navigation
fix: keep s13 and s16 process locking working on Windows - #592
Open
Steve-Kara wants to merge 1 commit into
Open
Steve-Kara wants to merge 1 commit into
Steve-Kara wants to merge 1 commit into
Conversation
Windows 既没有 fcntl 模块,也不能对 stdin 调用 select。s15_integrated_harness
已经做了 try/except 兜底,但 s13/s16 是直接 import fcntl,导致:
- s16_workflow_runtime 启动即 ModuleNotFoundError
- s13_agent_teams 启动即 OSError WinError 10038(对非套接字用 select)
改动(沿用 s15 已有的写法,但不降级为纯线程锁,而是保留真正的跨进程锁):
- s13/s16: fcntl.flock -> _lock_file/_unlock_file,Windows 分支走 msvcrt.locking
- s13: select.select([sys.stdin]) -> _stdin_ready(),Windows 分支走 msvcrt.kbhit()
- 重新生成 web/src/data/generated/{versions,docs}.json
(快照测试要求生成物与 s*/code.py 保持同步)
POSIX 分支行为与改动前完全一致(仍是 fcntl.flock / select)。
本机 Windows 全量测试:122 failed -> 41 failed(382 -> 445 passed)。
This branch has not been deployed
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.
Windows has no
fcntl, and can'tselect()on stdin.s15already guards this, buts13ands16still importfcntlat module level, so both stages crash on Windows:s16_workflow_runtime/code.py->ModuleNotFoundError: No module named 'fcntl's13_agent_teams/code.py->OSError: [WinError 10038](selecton a non-socket) once the import is fixedThis follows the fallback style already used in
s15, but keeps real cross-process locking on Windows viamsvcrt.lockinginstead of degrading to a thread-only lock --s16's run lock is what stops two host processes from running the same workflow run.s13's stdinselect()becomesmsvcrt.kbhit(), with redirected input still working.POSIX paths are untouched: on non-Windows the code still calls
fcntl.flock/select.select.Verified on Windows 11 + Python 3.12:
s16democompletes end to end,s13starts and accepts input; theTestworkflow's snapshot check already fails onmainfor unrelated reasons, so I left the generated files alone, same as #586.