Check resource before closing stream handle#31
Check resource before closing stream handle#31drealecs wants to merge 2 commits intom2mtech:mainfrom
Conversation
|
Looking into it more, I found that this was also documented in https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html:
The issue, for reference: aws/aws-sdk-php#929 |
|
We tested the patch in production and it fixed the issue with the fclose throwing an error because the stream was already closed. Let me know if this PR needs anything more. |
|
Hi @m2mtech, just a gentle ping. Let me know if you need any help with merging this or with any changes that you wish to do further here. |
After the specific Flysystem Adapter wrote the stream, it might have closed it.
So we double-check before trying to close it again.
This happens for
league/flysystem-aws-s3-v3->aws/aws-sdk-php->guzzlehttp/psr7and stream is wrapped inGuzzleHttp\Psr7\Streamthat on destruct closes it.Maybe they shouldn't close it, but we're not in control of it. So double-checking sounds reasonable.