Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-830

EventJobManager does supports concurrent enhancement of ContentItems with the same URI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • enhancer-0.10.0
    • Enhancer
    • None

    Description

      In the Stanbol Enhancer the EnhancementJobManager is responsible for executing the enhancement chains for all parsed ContentItems.

      There are several possibilities that ContentItems with the same URI are concurrently processed:

      (1) A user sends the same content to two different Enhancement Chains. As the URI of the contentItem is generated by using the MD5 of the parsed content both ContentItems will have the same URI

      (2) Users can manually parse the URI of the ContentItem by using the "id" query parameter. By using that feature it is simple to parse multiple ContentItems using the same URI

      (3) The MD5 of two contents parsed to the Enhancer may clash (very unlikely but still possible)

      The EventJobManager currently uses internally the EnhancementJob class to managed metadata about the exectution. Executions are managed in a Map that uses the EnhancementJob as key and a Semaphore as value. The Semaphore is used by the EventJobManager to wait for the completion async. enhancement process.

      The problem causing this issue is that the EnhancementJob class uses the URI of the ContentItem for its hashCode and equals implementation. because of this the EnhancementJobManager currently is not able to enhance two ContentItems with the same URI.

      So if two ContentItems with the same URI are parsed the execution of the 2nd one gets not initialized and therefore never completes. That means that - after the configured timeout - a ChainException is thrown with the very confusing error message "EnhancementJobManager was deactivated while enhancing the passed ContentItem".

      To fix this issue the hashCode and equals methods of the EnhancementJob need to be adapted to no longer depend on the URI of the ContentItem. The proposal is the just use the default implementations of java.lang.Object until one can come up with a better solution on how to (1) detect ContentItems with the same Content and parameters and (2) that are enhanced with the same Enhancement Chain.

      Attachments

        There are no Sub-Tasks for this issue.

        Activity

          People

            rwesten Rupert Westenthaler
            rwesten Rupert Westenthaler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: