Skip to content

AWS,Azure: Fix S3InputStream and ADLSInputStream connection leaks#13905

Merged
amogh-jahagirdar merged 1 commit into
apache:mainfrom
AnatolyPopov:more-input-stream-connection-leaks
Aug 25, 2025
Merged

AWS,Azure: Fix S3InputStream and ADLSInputStream connection leaks#13905
amogh-jahagirdar merged 1 commit into
apache:mainfrom
AnatolyPopov:more-input-stream-connection-leaks

Conversation

@AnatolyPopov

Copy link
Copy Markdown
Contributor

A follow-up to #13899 with more fixes of the same issue.

A follow-up to apache#13899 with more fixes of the same issue.
@AnatolyPopov AnatolyPopov force-pushed the more-input-stream-connection-leaks branch from 68f0f72 to 2ef33fe Compare August 22, 2025 22:17
@amogh-jahagirdar amogh-jahagirdar changed the title Fix S3InputStream and ADLSInputStream connection leaks AWS,Azure: Fix S3InputStream and ADLSInputStream connection leaks Aug 25, 2025
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.GetObjectRequest;

@ExtendWith(MockitoExtension.class)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having the separate unit test for the input stream in addition to the existing integration test is probably a good thing, since we can verify the stream reading logic independent of any behavior in the underlying client, and it'd be nice to run some tests here that don't require any environment setup.

At the moment it looks like we just assert the stream is closed but we may want to see if it's possible to build a shared abstraction between the unit and integration test which allows being able to plug in whichever client is desired; in the unit test case, a mocked client is plugged in and in the integration test case, a real client is plugged in. Then if there are any other clients out there someone could easily extend the test and run that.

@amogh-jahagirdar

Copy link
Copy Markdown
Contributor

Overall looks good to me thank you @AnatolyPopov and @nandorKollar for reviewing. Just had a future looking comment on our testing but nothing necessary in this PR imo.

@amogh-jahagirdar amogh-jahagirdar merged commit 360fb21 into apache:main Aug 25, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants