Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4573

Unable to serialize List<LuceneWork>

    Details

      Description

      When I try to fill distributed cache with indexing enabled concurrently from multiple threads, I get

      org.hibernate.search.exception.SearchException: HSEARCH000083: Unable to serialize List<LuceneWork>
              at org.hibernate.search.indexes.serialization.impl.LuceneWorkSerializerImpl.toSerializedModel(LuceneWorkSerializerImpl.java:92)
              ...
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 6
              at java.util.ArrayList.add(ArrayList.java:412)
              at org.hibernate.search.indexes.serialization.avro.impl.AvroSerializer.addFieldWithStringData(AvroSerializer.java:258)
              at org.hibernate.search.indexes.serialization.impl.LuceneWorkSerializerImpl.buildDocument(LuceneWorkSerializerImpl.java:174)
              at org.hibernate.search.indexes.serialization.impl.LuceneWorkSerializerImpl.toSerializedModel(LuceneWorkSerializerImpl.java:80)
      

      There are multiple different exceptions as cause, but the reason is one: AvroSerializer is not thead-safe. AvroSerializerProvider returns always the same instance, and so does InfinispanIndexManager (or rather DirectoryBasedIndexManager) return the same instance of LuceneWorkSerializerImpl wrapping the AvroSerializerProvider.

      This results in failed writes, corrupted data and another fun.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sannegrinovero Sanne Grinovero
                  Reporter:
                  rvansa Radim Vansa
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: