Skip to content

Fix StorageService.partition() to always close RandomAccessFile writers#14970

Open
iamsanjaymalakar wants to merge 1 commit intokestra-io:developfrom
iamsanjaymalakar:develop
Open

Fix StorageService.partition() to always close RandomAccessFile writers#14970
iamsanjaymalakar wants to merge 1 commit intokestra-io:developfrom
iamsanjaymalakar:develop

Conversation

@iamsanjaymalakar
Copy link

Problem

StorageService.partition() creates multiple RandomAccessFile writers but closes them via a forEach wrapper that can throw early. If one close() fails (or if an exception occurs during reading/writing), remaining writers may not be closed.

Fix

Move writer cleanup into a finally block so all RandomAccessFile instances are always closed. Close failures are aggregated (first exception thrown, subsequent ones suppressed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To review

Development

Successfully merging this pull request may close these issues.

1 participant