tanishqgandhi1908 opened a new pull request, #9145:
URL: https://github.com/apache/texera/pull/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)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to