fix: log _write_last_run failures instead of silent swallow#749
Open
23241a6749 wants to merge 1 commit into
Open
fix: log _write_last_run failures instead of silent swallow#74923241a6749 wants to merge 1 commit into
23241a6749 wants to merge 1 commit into
Conversation
The _write_last_run() function silently swallowed all exceptions with 'except Exception: pass'. Cache write failures (disk full, permissions, serialization errors) were completely invisible — no log, no stderr message, no metric. This made debugging report-cache issues impossible because the caller could not distinguish 'cache written' from 'cache write failed silently'. Fix: log the exception message to stderr with the [last30days] prefix, consistent with other error messages in the same file.
Contributor
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
_write_last_run()atlast30days.py:723silently swallowed all exceptions withexcept Exception: pass. Cache write failures — disk full, permission denied, serialization error, or aCONFIG_DIRfile-path collision — were completely invisible, with no log, no stderr message, and no return value to the caller.This made debugging report-cache issues impossible because the caller (
main()at line 1385) could not distinguishcache written successfullyfromcache write failed silently.Fix
Replace
except Exception: passwithexcept Exception as exc: sys.stderr.write(...)that reports the failure to stderr using the same[last30days]prefix as other error messages in the file. The exception is not re-raised — cache writes are best-effort and should not interrupt the run.Impact
Cache write failures are now visible on stderr. No behavior change on the success path. All existing tests continue to pass (they only exercise the success path).