Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25784

Fix ClassCastException on getChangeToken after a ConcurrentUpdateException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.10
    • Fix Version/s: 9.10-HF19, 10.3
    • Component/s: Elasticsearch
    • Tags:
    • Backlog priority:
      700
    • Sprint:
      nxFG 10.3.7
    • Story Points:
      2

      Description

      An exception occurs when reading the "changeToken" property to write it to the Elasticsearch request.

      Logs:

       ERROR [Nuxeo-Work-elasticSearchIndexing-2:2865555041367.2094492134] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: IndexingWorker(61f81dca-b429-4161-9bec-6a24277b72f4, , Progress(?%, ?/0), null)
      java.lang.ClassCastException: org.nuxeo.ecm.core.api.model.DeltaLong cannot be cast to java.lang.Long
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.getChangeToken(SQLDocumentLive.java:329)
      	at org.nuxeo.ecm.core.api.AbstractSession.getChangeToken(AbstractSession.java:2415)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getChangeToken(DocumentModelImpl.java:1513)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.JsonESDocumentWriter.writeSystemProperties(JsonESDocumentWriter.java:166)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.JsonESDocumentWriter.writeDoc(JsonESDocumentWriter.java:108)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.JsonESDocumentWriter.writeESDocument(JsonESDocumentWriter.java:236)
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.buildEsIndexingRequest(ElasticSearchIndexingImpl.java:416)
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processBulkIndexCommands(ElasticSearchIndexingImpl.java:177)
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:146)
      	at org.nuxeo.elasticsearch.ElasticSearchComponent.indexNonRecursive(ElasticSearchComponent.java:405)
      	at org.nuxeo.elasticsearch.work.IndexingWorker.doIndexingWork(IndexingWorker.java:73)
      	at org.nuxeo.elasticsearch.work.AbstractIndexingWorker.doWork(AbstractIndexingWorker.java:61)
      	at org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:48)
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:435)
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:355)
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      This happens in concurrency situations when a session is used after it previously got a ConcurrentUpdateException which aborted the save() mechanism (and failed to clean up properly the DeltaLong values).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h