Michael Skells created AVRO-4259:
------------------------------------

             Summary: Thread Safety of FastReader created via static GenericData
                 Key: AVRO-4259
                 URL: https://issues.apache.org/jira/browse/AVRO-4259
             Project: Apache Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.12.1
         Environment: I can supply some sample code if useful
            Reporter: Michael Skells


As I understand it readers are generally not threadsafe, for example a 
FastReader has mubable state
the problem is that a FastReader isgenerally created by a FastReaderBuilder 
within a GenericData, and there dont seem to be any guidlines documented to 
show that thread safety isnt guaranteed here, as the reader, or some part of 
the reader may be shared due to the identity of the schema being built, due to 
the way that the FastReaderBuilder works

To make matters worse, there is a static singleton GlobalData, which is now the 
default mechnaism to build a FastReader, and the code to build the FastReader 
is thread safe, or seems to be

It hard /impossible to reason about which FastReaders are shared and which are 
not due to the structure of a FastReader which may share child records and 
other structure (which may be shared even if the outer structure isnt, unless 
each top level FastReader is built from its own GenericData



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to