Windows: graphify update can hang in tempfile.mkstemp while saving manifest
Summary
On Windows, graphify update . can stop after AST extraction and never return. A faulthandler dump shows that Graphify is blocked in tempfile.mkstemp() while saving manifest.json.
Environment
- graphifyy 0.9.63
- Python 3.11.15, 64-bit
- Windows 11 Pro, version 10.0.26200, build 26200
- Target manifest path length: 55 characters (local project path redacted)
Reproduction
-
Use a project with an existing
graphify-out/directory and roughly 1,090 code files. -
Run:
graphify update . -
The command reports progress through AST extraction, for example:
AST extraction: 1000/1088 uncached files (91%) -
It then remains active without printing a completion message or returning.
A 20-second faulthandler timeout captured this stack:
File "...\Lib\tempfile.py", line 257 in _mkstemp_inner
File "...\Lib\tempfile.py", line 358 in mkstemp
File "...\graphify\paths.py", line 120 in _atomic_replace
File "...\graphify\paths.py", line 165 in write_json_atomic
File "...\graphify\detect.py", line 2418 in save_manifest
File "...\graphify\watch.py", line 1988 in _rebuild_code
Expected behavior
graphify update . completes or fails with a visible error and an actionable target path.
Actual behavior
The process blocks indefinitely in temporary-file creation. There is no final success or failure output.
Additional observations
- The graph artifacts had already been written and the resulting graph was valid (11,158 nodes, 40,276 edges; no missing or dangling endpoints).
- The manifest target is deliberately short, so this does not appear to be the Windows path-length issue described in #3351.
- In the current code,
_atomic_replace()callstempfile.mkstemp(dir=str(real.parent), prefix=".gfy-", suffix=".tmp")directly. The existing fallback around the lateros.replace()step cannot handle a block before that point.
A bounded retry/timeout around temporary-file creation, plus explicit diagnostic output naming the target file, would make this failure mode recoverable.