fix: Windows git clone failures — URL reinstall + pipe deadlock + file lock#2726
Merged
Conversation
…e lock Three fixes for Windows E2E failures: 1. cm_cli reinstall_node(): URL-based node specs used the full URL as lookup key, but internal dicts are keyed by repo basename or cnr_id. Use get_cnr_by_repo() for CNR-aware lookup with correct is_unknown flag. 2. git_helper.py gitclone(): disable tqdm progress when stderr is piped (sys.stderr.isatty() gate) to prevent pipe buffer deadlock. Also move stale directories from previous failed clones into .disabled/.trash/ before cloning (GitPython handle leak on Windows). 3. try_rmtree(): 3-tier deletion strategy for Windows file locks: retry 3x with delay, rename into .disabled/.trash/, then lazy-delete via reserve_script as final fallback.
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
Fixes three bugs causing URL-based node install/reinstall to fail on Windows.
reinstall_node()used the full URL as dictionary key, butunknown_active_nodesis keyed by repo basename — uninstall silently missed the nodeGitProgress(tqdm)saturated the 4KB Windows pipe buffer when stderr was piped, causing git clone to hang and exit 128try_rmtree()fell back to lazy-delete (restart-only) whenshutil.rmtreefailed, which is ineffective in cm-cli where there is no restart cycleChanges
cm_cli/main.py — reinstall_node() URL handling
core.is_valid_url()before callingresolve_node_spec()get_cnr_by_repo()to determine if URL maps to a CNR-registered nodeis_unknown=False(searchesactive_nodes)is_unknown=Truecomfyui_manager/common/git_helper.py — gitclone()
sys.stderr.isatty(): disable when piped to prevent deadlock.disabled/.trash/(handles GitPython memory-mapped handle leak on Windows)comfyui_manager/legacy/manager_core.py + glob/manager_core.py — try_rmtree()
.disabled/.trash/→ lazy-delete viareserve_scriptas final fallbackRelated