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

Unable to serialize List<LuceneWork>

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.0.0.Beta2
    • 7.0.0.Alpha5
    • Embedded Querying
    • None

      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.

            sgrinove Sanne Grinovero
            rvansa1@redhat.com Radim Vansa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: