)]}'
{
  "commit": "7804cbc610afea9ace918bdbef397c6321901f96",
  "tree": "2b2414e4342ea278500dfc068882eb7b195a7683",
  "parents": [
    "6e89247590dfb9380d156e1ef057ce1d96904c18"
  ],
  "author": {
    "name": "Yaowen Mei",
    "email": "ywmei@google.com",
    "time": "Tue Nov 10 09:01:40 2026 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Nov 10 09:01:40 2026 -0500"
  },
  "message": "Clean up truncated and partial files on failed CAS downloads (#674)\n\nWhen streaming a blob to a file in readBlobToFileUnder or ReadBlobToFile,\nthe target file is opened with os.O_WRONLY|os.O_CREATE|os.O_TRUNC before\nstreaming begins. Similarly, in downloadNonUnified, batch output files\nwere written before checking whether BatchDownloadBlobsWithStats returned\nan error, and single-file downloads used the parent ctx instead of the\nerrgroup\u0027s eCtx. If a download fails (for example, after exhausting\nretries with codes.Unavailable during a CAS outage or receiving a partial\nstream that fails digest verification), an empty (0-length) or partially\nwritten file was left behind on disk, corrupting incremental builds\n(b/553667080).\n\nThis change fixes truncated/partial file handling in CAS downloads:\n1. Explicitly close the destination file (checking closeErr) and remove\n   the target file on error in ReadBlobToFile and readBlobToFileUnder so\n   0-byte or partial files are never left on disk.\n2. Check BatchDownloadBlobsWithStats errors immediately before writing\n   files in downloadNonUnified, verify digest presence in bchMap before\n   dereferencing batch results, and pass eCtx to readBlobToFileUnder so\n   in-flight streams abort and clean up promptly on sibling errors.\n\nUnifiedDownloads\u003dtrue error handling and DownloadFiles sibling\ncancellation are tracked separately in #676.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c5943d3ffeb54532467cfc64e109eb3834a91511",
      "old_mode": 33188,
      "old_path": "go/pkg/client/cas_download.go",
      "new_id": "eec4550535def4f8c5e91dad19c32bcdc7ce1db1",
      "new_mode": 33188,
      "new_path": "go/pkg/client/cas_download.go"
    },
    {
      "type": "modify",
      "old_id": "0b8f12cb66897739e5547557f880638484ad6c5a",
      "old_mode": 33188,
      "old_path": "go/pkg/client/cas_test.go",
      "new_id": "1670306161a54169b6bb247b116262ddfa83ba7c",
      "new_mode": 33188,
      "new_path": "go/pkg/client/cas_test.go"
    },
    {
      "type": "modify",
      "old_id": "1fa5fb44acf750cf830663b2a7d93bb553ad8650",
      "old_mode": 33188,
      "old_path": "go/pkg/client/retries_test.go",
      "new_id": "e67b55e38871dab888186e8668de942788955e68",
      "new_mode": 33188,
      "new_path": "go/pkg/client/retries_test.go"
    }
  ]
}
