Fix FileNotFoundError when validating cache for deleted directories#12015
Open
VitoChenLY wants to merge 1 commit intoComfy-Org:masterfrom
Open
Fix FileNotFoundError when validating cache for deleted directories#12015VitoChenLY wants to merge 1 commit intoComfy-Org:masterfrom
VitoChenLY wants to merge 1 commit intoComfy-Org:masterfrom
Conversation
Member
Test Evidence CheckIf this PR modifies behavior that requires testing, a test explanation is required. PRs lacking applicable test explanations may not be reviewed until added. Please add test explanations to ensure code quality and prevent regressions. If this PR changes user-facing behavior, visual proof (screen recording or screenshot) is required. PRs without applicable visual documentation may not be reviewed until provided. You can add it by:
|
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.
Problem
When calling the
/object_infoAPI endpoint, ComfyUI may crash with aFileNotFoundErrorif a directory that was previously scanned and cached has been manually deleted.Error Details
Root Cause
seed_assets(["models"])function (introduced in v0.9.2) scans all model directories and caches their structure, including subdirectories likemodels/t5.filename_list_cache).models/t5) that was previously cached, the cache still contains a reference to it.cached_filename_list_()validates the cache by checking directory modification times, it callsos.path.getmtime(folder)on the deleted directory, causing aFileNotFoundError.Impact