Skip to content

bugfix: closed resource handles#3314

Merged
stobrien89 merged 1 commit into
aws:masterfrom
stobrien89:bugfix-resource-handle-close
Jun 24, 2026
Merged

bugfix: closed resource handles#3314
stobrien89 merged 1 commit into
aws:masterfrom
stobrien89:bugfix-resource-handle-close

Conversation

@stobrien89

Copy link
Copy Markdown
Member

Issue #, if available:
Fixes #3295

Description of changes:
After #3290, Stream objects were no longer kept alive indefinitely by circular references in our middleware stack, which caused user-provided file handles to be closed when the Guzzle streams we wrapped them with were garbage-collected.

The fix takes user-provided resource handles and uses a decorator on the Stream objects we wrap them with to detach rather than close the resource when garbage-collected.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@stobrien89 stobrien89 requested a review from smilkuri as a code owner June 24, 2026 17:42
@stobrien89

Copy link
Copy Markdown
Member Author

Smoke Tests:

vendor/bin/behat --format=progress --suite=smoke --tags='~@noassumerole'
...................................................................... 70
...................................................................... 140
...................................................................... 210
............

111 scenarios (111 passed)
222 steps (222 passed)
0m26.77s (15.14Mb)

Integ Tests:

vendor/bin/behat --format=progress --tags=integ
...................................................................... 70
...................................................................... 140
...................................................................... 210
...................................................................... 280
...................................................................... 350
...................................................................... 420
...................................................................... 490
.....................

147 scenarios (147 passed)
511 steps (511 passed)
18m52.79s (702.52Mb)

@stobrien89 stobrien89 merged commit 61539c5 into aws:master Jun 24, 2026
17 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.

Breaking change in 3.383.1: file handles are now closed by S3Client->upload()

2 participants