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
JSON decoding error parsing stream encoded with Jackson Smile #24198
Comments
Test project attached: |
I'm not sure it's a synchronisation issue. I disabled the Maybe it was the "shared name reference" mentioned in the exception that put you on the track of synchronisation, but that is a feature of Smile. Moreover, I was able to reproduce this issue without using any Spring code, see https://github.com/poutsma/jackson-smile-issue. It does use Reactor, but I suspect the issue is in Jackson itself. @feutche As the original reporter, could you please report this Jackson issue here, possibly pointing to my repo? |
Closed as invalid, as the issue can be reproduced without Spring code. |
Thanks for looking into it. Sorry I wasn't clear as I didn't mean multithreading/concurrency issue but more of maybe inconsistent use of generator and parser so their shared name buffers aren't in sync. I still think it's the case - in your example (in your repo) - |
So I think this issue should be reopened, the problem is not in Jackson but in the way it's inconsistently used between encoder and decoder. |
Ok, reopening, but I won't have time to look into this until after my Christmas break. |
Before this commit, the AbstractJackson2Encoder instantiated a ObjectWriter per value. This is not an issue for single values or non-streaming scenarios (which effectively are the same, because in the latter values are collected into a list until offered to Jackson). However, this does create a problem for SMILE, because it allows for shared references that do not match up when writing each value with a new ObjectWriter, resulting in errors parsing the result. This commit uses Jackson's SequenceWriter for streaming scenarios, allowing Jackson to reuse the same context for writing multiple values, fixing the issue described above. Closes gh-24198
Thanks for spotting this. We are now using a Jackson |
Affects: 5.1.12
With #24009 fixed and versions updated, there's still issues with decoding Smile-encoded stream. Looks like a missyncronization between use of generator and parser:
The text was updated successfully, but these errors were encountered: