The GitHub Actions job "Release Auditing" on 
texera.git/gh-readonly-queue/main/pr-9145-12999929f1ce305a7f09b80f19f702ad2bc59c90
 has succeeded.
Run started by GitHub user aicam (triggered by aicam).

Head commit for run:
8fbd4f2267d6cf61fd76f9b00ea192572b50702b / Tanishq Gandhi 
<[email protected]>
fix(file-service, workflow-core): delete the temp files a version zip download 
leaves behind (#9145)

### What changes were proposed in this PR?

The LakeFS SDK's `getObject().execute()` saves each object to a temp
file and returns it. Two callers never deleted it:

- `ResourceUploadService.versionZipResponse` (dataset and model
`versionZip`) copied each file into the zip and left it in the temp
directory, so every download left a full copy of the version on the file
service's disk.
- `LakeFSFileDocument.asInputStream`'s fallback, used when the presigned
download fails, opened the temp file as a stream and left it behind.

The zip now deletes each temp file right after copying it (in a
`finally`), and the fallback opens it with `DELETE_ON_CLOSE`, so it's
removed when the stream is closed.

Three downloads of a version holding three 1 MB files, with the file
service's temp dir pointed at an empty folder:

```
           before            after
download 1 3 files, 3.0M     0 files
download 2 6 files, 6.0M     0 files
download 3 9 files, 9.0M     0 files
```

The zip's contents are unchanged (byte-for-byte identical files).

### Any related issues, documentation, discussions?

Closes #9144

### How was this PR tested?

Added a case to `DatasetResourceSpec` (writing a version zip leaves no
SDK temp files) and one to `LakeFSFileDocumentSpec` (reading through the
lakeFS fallback and closing the stream leaves none). Both fail without
the fix.

```
sbt "WorkflowCore/testOnly *LakeFSFileDocumentSpec" "FileService/testOnly 
*DatasetResourceSpec *ModelResourceSpec"
# Tests: succeeded 22 / 181, failed 0
```

Also checked against a local stack with the file service's temp dir
pointed at an empty folder (table above).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

Report URL: https://github.com/apache/texera/actions/runs/40382780236

With regards,
GitHub Actions via GitBox

Reply via email to