graphify icon indicating copy to clipboard operation
graphify copied to clipboard

Windows: graphify update can hang in tempfile.mkstemp while saving manifest

Open Tycos opened this issue 2 months ago • 0 comments

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

  1. Use a project with an existing graphify-out/ directory and roughly 1,090 code files.

  2. Run:

    graphify update .

  3. The command reports progress through AST extraction, for example:

    AST extraction: 1000/1088 uncached files (91%)

  4. 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() calls tempfile.mkstemp(dir=str(real.parent), prefix=".gfy-", suffix=".tmp") directly. The existing fallback around the later os.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.

Tycos avatar Sep 17 '26 18:09 Tycos