Skip to content

fix(io): close all streams in ListOutputStream#close#2392

Merged
mykola-mokhnach merged 1 commit intoappium:masterfrom
iamsanjaymalakar:master
Mar 10, 2026
Merged

fix(io): close all streams in ListOutputStream#close#2392
mykola-mokhnach merged 1 commit intoappium:masterfrom
iamsanjaymalakar:master

Conversation

@iamsanjaymalakar
Copy link
Contributor

Change list

  • Make ListOutputStream.close() close all underlying OutputStreams even if one close() throws.
  • Collect the first IOException and attach subsequent close failures as suppressed exceptions, then rethrow after attempting all closes.

Types of changes

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

ListOutputStream.close() previously stopped at the first IOException, which could leave remaining streams unclosed and potentially leak resources. The updated implementation attempts to close every stream and only throws after cleanup is complete (preserving additional failures via suppressed exceptions).

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 9, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: iamsanjaymalakar / name: Sanjay Malakar (c75eda7)

@iamsanjaymalakar iamsanjaymalakar changed the title Fix ListOutputStream.close() to close all streams on failure fix(io): close all streams in ListOutputStream#close Mar 9, 2026
@mykola-mokhnach mykola-mokhnach merged commit 1f0a2f8 into appium:master Mar 10, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants