Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50853][CORE] Close temp shuffle file writable channel
### What changes were proposed in this pull request? Currently, there are two implementations of DownloadFileWritableChannel (which is used for writing data fetched to disk), SimpleDownloadWritableChannel and EncryptedDownloadWritableChannel. The latter closes the writable channel in it's implementation of closeAndRead method while the former does not. As a result, SimpleDownloadWritableChannel channel is never closed and is relying on either the finalizer in FileOutputStream or the phantom cleanable in FileDescriptor to close the file descriptor. The change in this PR is to close the channel in SimpleDownloadWritableChannel closeAndRead method. ### Why are the changes needed? Should be closing file handles when they are not needed anymore instead of relying on finalizer/cleanables to do it. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing spark tests. ### Was this patch authored or co-authored using generative AI tooling? No Closes #49531 from ChenMichael/SPARK-50853-close-temp-shuffle-file-channel. Authored-by: Michael Chen <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information