In #169 and #170, we made some changes to call a previously assigned stream or channel instead of a new one passed as a parameter.
But I found https://github.com/spring-projects/spring-framework does the followings when it returns a HTTP request with jackson-dataformat-msgpack.
- Reuses an OutputStream (
org.apache.catalina.connector.CoyoteOutputStream) without having called its close()
- Of course, it includes a new
SocketChannel each time
- Creates a new
org.msgpack.jackson.dataformat.MessagePackGenerator
- Which calls
org.msgpack.core.buffer.OutputStreamBufferOutput#reset internally except for the first time
As a result, the OutputStream the framework tries to reuse will be closed unexpectedly and MessagePack fails to write data to it.
Also, on second thought, I think MessageBuffer(Input|Output)#reset shouldn't close the previous output or channel for the following reasons.
- Closing the previous output or channel in the methods is unexpected behaviour for the user and we can't know what it causes (it depends on their implementation)
- Releasing those resources are basically the user's responsibility
Also, on second thought, it sounds MessageBuffer(Input|Output)#reset shouldn't close the previous output or channel for the following reasons.
@xerial What do you think? If the above ideas sound good, I can fix this issue easily.
In #169 and #170, we made some changes to call a previously assigned stream or channel instead of a new one passed as a parameter.
But I found https://github.com/spring-projects/spring-framework does the followings when it returns a HTTP request with jackson-dataformat-msgpack.
org.apache.catalina.connector.CoyoteOutputStream) without having called its close()SocketChanneleach timeorg.msgpack.jackson.dataformat.MessagePackGeneratororg.msgpack.core.buffer.OutputStreamBufferOutput#resetinternally except for the first timeAs a result, the OutputStream the framework tries to reuse will be closed unexpectedly and MessagePack fails to write data to it.
Also, on second thought, I think MessageBuffer(Input|Output)#reset shouldn't close the previous output or channel for the following reasons.
Also, on second thought, it sounds MessageBuffer(Input|Output)#reset shouldn't close the previous output or channel for the following reasons.
@xerial What do you think? If the above ideas sound good, I can fix this issue easily.