-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close Parsers and Generators #586
Conversation
Close parsers and generators to return buffers to the pool.
Was there an issue filed for this? It's closing streams it may not own causing issues in containers. The linked SpringBoot issue is an example. I'm seeing the same thing in WildFly/RESTEasy with some tests. |
Just to follow up, the WildFly/RESTeasy regression will be fixed by RESTEASY-3397. This fix is correct according the |
There was not. Sorry for the trouble, I did not consider the possible impact this may cause to consumers downstream.
Reading the Javadoc of
Should we raise these with https://github.com/jakartaee/jsonb-api? |
@marschall That's a good catch. I was in a rush on Friday when I was attempting to figure out what the issue was. It does make sense to make the Maybe it is a good idea to keep them open like |
…a commit, eclipse-ee4j/yasson#586, which closes input streams. This could cause issues where the user is expecting to be able to re-use the InputStream that was passed in. Signed-off-by: James R. Perkins <[email protected]>
Will this change by chance be reverted or partially reverted to not close the streams? |
If there is tentative agreement that the streams should remain open and the spec and TCK should be updated accordingly I can work on a PR that restores the original behaviour regarding streams but closes the parsers but still returns the buffers to the pool. |
just ran into this issue while reading multiple ZipEntry from a ZipInputStream. yasson closed the stream after the first entry was read... as a workaround i read the data into byte[] and used fromJson on that. however this defeats the whole purpose of streaming either revert this change or at least add an option to control this behavior |
Just as an FYI, what I've done is wrapped the |
I opened #631 |
Close parsers and generators to return buffers to the pool.
JsonBinding
currently does not#close
the parsers and generators is creates resulting inorg.eclipse.parsson.api.BufferPool#recycle(char[])
not being called resulting in unnecessarily high allocation rates