tanishqgandhi1908 opened a new issue, #9144:
URL: https://github.com/apache/texera/issues/9144
### What happened?
versionZip (datasets and models) builds the zip from
LakeFSStorageClient.getFileFromRepo, which calls the LakeFS SDK’s
getObject().execute(). The SDK saves each object to a new temp file and returns
it. ResourceUploadService.versionZipResponse copies that file into the zip but
never deletes it, so every download leaves a full copy of the version’s files
in the file service’s temp directory.
The same leak exists in LakeFSFileDocument.asInputStream’s fallback path,
used when the presigned download fails: it opens the temp file as a stream and
never deletes it.
Expected: temp files are removed once their content has been copied or read.
Three downloads of a version holding three 1 MB files, with the file
service’s temp dir pointed at an empty folder:
```
temp folder before: 0 files
download 1: HTTP 200, 3147040 bytes -> temp folder: 3 files, 3.0M
download 2: HTTP 200, 3147040 bytes -> temp folder: 6 files, 6.0M
download 3: HTTP 200, 3147040 bytes -> temp folder: 9 files, 9.0M
-rw------- 1048576 download-12762334686938888414
-rw------- 1048576 download-15927308181343779728
...
```
### How to reproduce?
Start the file service with -Djava.io.tmpdir=<empty folder>.
Create a dataset version with a few files.
Download it as a zip (Versions & Files → download version, or GET
/api/dataset/{did}/versionZip?dvid=...) a few times.
The temp folder gains one download-* file per file per download, and they’re
never removed.
### Version/Branch
1.4.0-incubating-SNAPSHOT (main)
### Commit Hash (Optional)
_No response_
### What browsers are you seeing the problem on?
_No response_
### Relevant log output
```shell
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]