You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ByteStreamJVM.writeToOutputStream is documented as This method does not flush or close the given OutputStream. but does close the stream (indirectly).
outputStream.sink() ultimately creates an okio.OutputStreamSink that has override fun close() = out.close()
We ran across this writing S3 objects (in a loop) to a ZipOutputStream that was closed after the first call to body.writeOutputStream(...).
Regression Issue
Select this option if this issue appears to be a regression.
Expected behavior
Expecting that writing to a stream does not close it. One may wish to write further data to the stream, as is the case with a ZipOutputStream with multiple entries.
Current behavior
writeOutputStream closes the stream, contradicting the documented behaviour.
Steps to Reproduce
Pass a stream into any ByteStream.writeToOutputStream and check its state after the call.
Possible Solution
Wrap in some form of close-suppressing sink, or a close-suppressing OutputStream.
We worked around this by doing body.toInputStream().copyTo(outputStream) (which isn't great, that InputStream may or may not need to be closed...)
Context
Good for now - pls restore the documented functionality!
AWS SDK for Kotlin version
1.3.52 (unclear where the regression happened, or if this ever worked as documented)
Platform (JVM/JS/Native)
JVM
Operating system and version
any
The text was updated successfully, but these errors were encountered:
Hi, thanks for the report. I've set this as high priority and will begin working on it as soon I'm finished with unrelated work as part of my on call shift.
0marperez
added
p1
This is a high priority issue
and removed
p1
This is a high priority issue
potential-regression
Marking this issue as a potential regression to be checked by team member
labels
Oct 18, 2024
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Hello, we've merged a fix for this issue and it'll be included in an upcoming release. writeToOutputStream will maintain its existing behavior to ensure backwards compatibility, and a new appendToOutputStream method was added which does not close the stream.
Describe the bug
ByteStreamJVM.writeToOutputStream
is documented asThis method does not flush or close the given OutputStream.
but does close the stream (indirectly).outputStream.sink()
ultimately creates anokio.OutputStreamSink
that hasoverride fun close() = out.close()
We ran across this writing S3 objects (in a loop) to a ZipOutputStream that was closed after the first call to
body.writeOutputStream(...)
.Regression Issue
Expected behavior
Expecting that writing to a stream does not close it. One may wish to write further data to the stream, as is the case with a ZipOutputStream with multiple entries.
Current behavior
writeOutputStream closes the stream, contradicting the documented behaviour.
Steps to Reproduce
Pass a stream into any ByteStream.writeToOutputStream and check its state after the call.
Possible Solution
Wrap in some form of close-suppressing sink, or a close-suppressing OutputStream.
We worked around this by doing
body.toInputStream().copyTo(outputStream)
(which isn't great, that InputStream may or may not need to be closed...)Context
Good for now - pls restore the documented functionality!
AWS SDK for Kotlin version
1.3.52 (unclear where the regression happened, or if this ever worked as documented)
Platform (JVM/JS/Native)
JVM
Operating system and version
any
The text was updated successfully, but these errors were encountered: