Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error reporting for unexpected output file deletion #1270

Merged
merged 9 commits into from
Jan 28, 2025

Conversation

aomarks
Copy link
Member

@aomarks aomarks commented Jan 28, 2025

Background

Before and after execution of a script, wireit globs and stats the output files in order to remember them across runs. If some process is simultaneously writing to the same output files out-of-band, it is possible for an output file to be deleted in the small amount of time between globbing it and stat'ing it.

Before this PR, this situation was not detected, and just resulted in an unknown exception, which we log as an "Internal error".

Main change

After this PR, this situation is specifically detected, and we give a more useful error:

[foo] Output file "./some/file.js" was deleted unexpectedly. Is another process writing to the same location?

Other changes

  • When an unhandled exception occurs, we now report it with the name of the specific script that failed, instead of with the top-level entry-point script (by catching unknown exceptions on individual script executions, instead of only at the very top-level as before).

  • Added a test for the similar case where an input file is deleted during fingerprinting, and tweaked the error message to suggest that another process might be the cause.

  • Clarified the default logger vs the simple logger in the README and class names (the default changed from simple to quiet recently, but the README and class names were not quite in sync).

  • Document the WIREIT_DEBUG_LOG_FILE variable.

cc @timswanson-google

@aomarks aomarks requested a review from rictic January 28, 2025 19:41
@aomarks aomarks force-pushed the compute-manifest-bug branch from e44c2d6 to 365ce42 Compare January 28, 2025 19:42
@aomarks aomarks force-pushed the compute-manifest-bug branch from 365ce42 to bfbff17 Compare January 28, 2025 19:43
@aomarks aomarks force-pushed the compute-manifest-bug branch from 3a7717c to 7eb2c1e Compare January 28, 2025 20:14
@aomarks aomarks merged commit b671bc9 into main Jan 28, 2025
20 checks passed
@aomarks aomarks deleted the compute-manifest-bug branch January 28, 2025 20:26
aomarks added a commit to breadboard-ai/breadboard that referenced this pull request Jan 28, 2025
Brings in google/wireit#1270 which does a better
job at reporting errors relating to input/output files being
unexpectedly deleted as wireit is executing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants