[infinispan-issues] [JBoss JIRA] (ISPN-4573) Unable to serialize List<LuceneWork>

Radim Vansa (JIRA) issues at jboss.org
Fri Jul 25 09:29:30 EDT 2014


     [ https://issues.jboss.org/browse/ISPN-4573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radim Vansa updated ISPN-4573:
------------------------------

    Description: 
When I try to fill distributed cache with indexing enabled concurrently from multiple threads, I get 
{code}
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)
{code}

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.

  was:
When I try to fill distributed cache with indexing enabled concurrently from multiple threads, I get 
{code}
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)
{code}

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.



> Unable to serialize List<LuceneWork>
> ------------------------------------
>
>                 Key: ISPN-4573
>                 URL: https://issues.jboss.org/browse/ISPN-4573
>             Project: Infinispan
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Embedded Querying
>    Affects Versions: 7.0.0.Alpha5
>            Reporter: Radim Vansa
>            Assignee: Sanne Grinovero
>
> When I try to fill distributed cache with indexing enabled concurrently from multiple threads, I get 
> {code}
> 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)
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the infinispan-issues mailing list