3 Replies Latest reply on Jan 18, 2017 11:07 AM by Vlad St

    ERROR: LockObtainFailedException: lock instance already assigned

    Nikita Dobryukha Newbie

      Hello,

      It's again me.

      I have the following simple test class - TestRealHotRodServer.java

      with 2 pojo classes: Book.java and User.java

      marshallers: BookMarshaller.java and UserMarshaller.java

      and proto-files: book.proto and user.proto

      and the following cache configuration wich was taken from the example clustered-indexing.xml

      <replicated-cache-configuration name="indexed" mode="SYNC" start="EAGER">
        <indexing index="LOCAL">
        <property name="default.directory_provider">infinispan</property>
        <property name="default.metadata_cachename">indexMetadata</property>
        <property name="default.data_cachename">indexData</property>
        <property name="default.locking_cachename">indexLocking</property>
        <property name="lucene_version">LUCENE_CURRENT</property>
        </indexing>
      </replicated-cache-configuration>
      
      
      <local-cache name="indexMetadata" start="E    AGER">
        <indexing index="NONE"/>
      </local-cache>
      <local-cache name="indexData" start="EAGER">
        <indexing index="NONE"/>
      </local-cache>
      <local-cache name="indexLocking" start="EAGER">
        <indexing index="NONE"/>
      </local-cache>
      
      
      <replicated-cache name="booksCache" configuration="indexed"/>
      <replicated-cache name="usersCache" configuration="indexed"/>
      
      
      

       

      When I launch the test-class, the testBooksCache (for example) ends successfully, but during testUsersCache's put operation in the infinispan server log appears an error and search results list is empty.

      11:37:30,709 ERROR [org.hibernate.search.exception.impl.LogErrorHandler] (Hibernate Search sync consumer thread for index org.infinispan.query.remote.impl.indexing.ProtobufValueWrapper) HSEARCH000058: Exception occurred org.apache.lucene.store.LockObtainFailedException: lock instance already assigned
      Primary Failure:
              Entity org.infinispan.query.remote.impl.indexing.ProtobufValueWrapper  Id A:GOGamYjq76DwZw==  Work Type  org.hibernate.search.backend.UpdateLuceneWork
      : org.apache.lucene.store.LockObtainFailedException: lock instance already assigned
              at org.infinispan.lucene.impl.CommonLockObtainUtils.failLockAcquire(CommonLockObtainUtils.java:33)
              at org.infinispan.lucene.impl.CommonLockObtainUtils.attemptObtain(CommonLockObtainUtils.java:20)
              at org.infinispan.lucene.impl.BaseLockFactory.obtainLock(BaseLockFactory.java:35)
              at org.infinispan.lucene.impl.BaseLockFactory.obtainLock(BaseLockFactory.java:18)
              at org.infinispan.lucene.impl.DirectoryLucene.obtainLock(DirectoryLucene.java:152)
              at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:776)
              at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:123)
              at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:89)
              at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
              at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriterDelegate(AbstractWorkspaceImpl.java:203)
              at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:80)
              at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:46)
              at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.applyChangesets(SyncWorkProcessor.java:158)
              at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.run(SyncWorkProcessor.java:147)
              at java.lang.Thread.run(Thread.java:745)