Comments (4)
Thanks for the information !
It seems, indeed, to be a problematic similar to #479
from jackson-dataformats-binary.
Thank you for reporting this, @simondaudin -- and especially for providing the reproduction!
Without looking too deep, based on failure and test code, it does seem like a legit bug somewhere and not incorrect usage.
But I hope to add more information when I have time to look into this problem.
from jackson-dataformats-binary.
Hello, thanks for the response.
I actually got curious and went digging a little bit.
It seems due to SmileBufferRecycler
being created in the main
thread and so, created only once in SmileParserBase
ThreadLocal _smileRecyclerRef
and then used inside all the parallel thread.
Second problem, in SmileBufferRecycler
there is a race condition between the get and the set to null.
I tried two solutions that both worked:
- wrapped
SmileBufferRecycler._seenNamesBuffer
in an AtomicReference - replacing the
SmileParserBase._smileBufferRecycler
field by the method with the same name so that it is lazily instantiated by the correct thread when needed
In the first solution, we only have one instance of SmileBufferRecycler
shared by all the parallel threads.
I had no further insights about what it was supposed to be in this context, so I was not sure about making a PR.
from jackson-dataformats-binary.
This may be due to earlier assumptions that parser instances were bound 1-to-1 on threads, and as such buffer recyclers would work without explicit synchronization as long as ThreadLocal
was used. This turned out not to be the case with async processing, and changes have been made in jackson-core
for recycling of symbol tables, for example.
But I suspect not for SmileBufferRecycler
; it predates async Smile parser as well.
So this gives a reasonable idea that adding unfortunate-but-now-necessary locking is probably needed.
src/main/java/com/fasterxml/jackson/core/util/BufferRecycler.java
from jackson-core
may provide some clues, I forget exact changes that have been made over various versions.
from jackson-dataformats-binary.
Related Issues (20)
- `ProtobufParser.currentName()` returns wrong value at root level
- Unexpected `ArrayIndexOutOfBoundsException` in `CBORParser` for corrupt String value
- IonReader.newBytes() throwing `NegativeArraySizeException` HOT 1
- `IonReader` throws `AssertionError` for Timestamp value HOT 1
- `IonReader.next()` throws `ArrayIndexOutOfBoundsException` for some corrupt content HOT 4
- Support for `StreamReadConstraints.maxNameLength` validation for CBOR, Smile backends
- Protobuf `LocalDateTime` serialization as Root value throws `UnsupportedOperationException` HOT 5
- Upgrade `ion-java` to latest (1.11.4)
- Upgrade `ion-java` to latest (1.11.7)
- ION deserialization type change from Double to Float in 2.17.0 HOT 7
- ION - MappingIterator skip the first line HOT 8
- Avro Schema generation: allow mapping Java Enum properties to Avro String values HOT 7
- Issue in Smile shared string values due to avoiding 0xFE and 0xFF HOT 6
- Failed copy(): `IonValueMapper` does not override copy() HOT 5
- [AVRO] 2 fields in schema for single property when getter and setter contain property name in capitals. HOT 3
- Upgrade `ion-java` dependency to 1.11.8
- Cannot deserialize `UUID` values HOT 8
- IonValueMapper.builder() not implemented, does not register modules HOT 2
- Avro 1.12.0 breaks jackson-dataformat-avro (also: requires JDK 11) HOT 14
- Issue with canonical CBOR serialization and removing RFC7049#2.4 type hints HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jackson-dataformats-binary.