Repository navigation
Commit 24e3023
fix(artifacts): keep each retried attempt's profile and exec log
`--profile` and the compact execution log are one path per task, reused by
every retry attempt, so attempt N+1 truncates attempt N's file. Two costs.
The evidence for the failure is destroyed. A task only retries because an
attempt went wrong, and that attempt's timing profile and execution log are
exactly what you would read to find out why — but the retry overwrites both
before either is uploaded, so only the attempt that succeeded is ever
collected.
It also breaks the previous attempt's upload mid-stream. Bazel digests the
finished profile, then streams it asynchronously under
`--build_event_binary_file_upload_mode=fully_async`; a retry that starts
during that window replaces the file with a fresh 10-byte gzip header, and
the CAS rejects the mismatch:
WARNING: Uploading BEP referenced local file …profile.gz
hash: "b1f4c12b…" size_bytes: 723045
: INVALID_ARGUMENT: Buffer is 10 bytes in size, while 723045 bytes were expected
Ten bytes is a `GZIPOutputStream` header with no trailer — an empty gzip
file is 20 — which is what identifies the writer as a starting attempt
rather than a truncated remnant. The error names the CAS, so it reads as a
remote-cache fault and sends anyone debugging it in the wrong direction.
A `bazel_attempt_end` hook now moves both files aside as each attempt ends:
that hook runs after `wait()` returns and before the retry decision, so the
file is complete and closed. The final attempt still uploads under the
canonical `profile.gz` / `execlog.zstd`, so a task that never retried is
unchanged; earlier attempts arrive as `attempt-N.profile.gz`.
The attempt number goes before the extension because silo's
`deployments/automation/deploy-helm.sh` collects the profile with
`ls -t /workflows/*.profile.gz`, which a trailing `.attempt-N` would miss.
`bep_path` is left alone: the CLI owns that sink, not Bazel.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent fdf5ecc commit 24e3023
1 file changed
Lines changed: 58 additions & 8 deletions
Lines changed: 58 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | | - | |
735 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
736 | 740 | | |
737 | 741 | | |
738 | 742 | | |
| |||
839 | 843 | | |
840 | 844 | | |
841 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
842 | 883 | | |
843 | 884 | | |
844 | 885 | | |
| |||
903 | 944 | | |
904 | 945 | | |
905 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
906 | 951 | | |
907 | 952 | | |
908 | 953 | | |
| |||
915 | 960 | | |
916 | 961 | | |
917 | 962 | | |
918 | | - | |
919 | | - | |
920 | 963 | | |
921 | 964 | | |
922 | | - | |
923 | | - | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
924 | 974 | | |
925 | 975 | | |
926 | 976 | | |
927 | 977 | | |
928 | 978 | | |
929 | 979 | | |
930 | | - | |
| 980 | + | |
931 | 981 | | |
932 | 982 | | |
933 | 983 | | |
| |||
0 commit comments