Bug 1666491 - Pre: Delete failed (likely partially) processed artifacts. r=firefox-build-system-reviewers,glandium

It's possible that the processed file has not been created.

Differential Revision: https://phabricator.services.mozilla.com/D162073
This commit is contained in:
Nick Alexander 2022-11-17 10:57:39 +00:00
parent c3a6f96327
commit 2ad8d1f3cb

View File

@ -1392,7 +1392,15 @@ https://firefox-source-docs.mozilla.org/contributing/vcs/mercurial_bundles.html
{"processed_filename": processed_filename},
"Writing processed {processed_filename}",
)
self._artifact_job.process_artifact(filename, processed_filename)
try:
self._artifact_job.process_artifact(filename, processed_filename)
except Exception as e:
# Delete the partial output of failed processing.
try:
os.remove(processed_filename)
except FileNotFoundError:
pass
raise e
self._artifact_cache._persist_limit.register_file(processed_filename)