Handle OSError in get_latest_mtime during directory walk#6632
Merged
Conversation
957a733 to
fb0d7db
Compare
mdegat01
requested changes
Mar 16, 2026
Contributor
mdegat01
left a comment
There was a problem hiding this comment.
Looks good but anytime we catch OSError our rule has been to do a bad message check and report. Should probably get one in here if suppressing that with a warning or else let that one bubble when we see it.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
fb0d7db to
2e00d44
Compare
Besides file not found also catch "Too many levels of symbolic links" which can happen when there are symbolic link loops in the add-on/apps repository. Also improve error handling in the repository update process to catch OSError when checking for local modifications and raise a specific error that can be handled appropriately. Fixes SUPERVISOR-1FJ0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2e00d44 to
862b80a
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed change
Broaden the exception handler in
get_latest_mtimefromFileNotFoundErrorto handleOSErrorand log a debug message for skipped paths. This is a bit of a best effort approach handling skipping on not really relevant/critical errors during the directory walk. So far we skipENOENT(which is essentiallyFileNotFoundError) and ELOOP (Errno 40: Too many levels of symbolic links).Type of change
Additional information
Checklist
ruff format supervisor tests)If API endpoints or add-on configuration are added/changed: