Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-19471

Duplicate entries in the asynchronous document static analyzis queue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 14.1-rc-1
    • Fix Version/s: 14.1
    • Component/s: Index
    • Labels:
      None
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      There are duplicate entries in the task queue for document analysis on startup, causing warnings like

      2022-02-25 14:48:21,304 [task-manager-consumer] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
      2022-02-25 14:48:21,304 [task-manager-consumer] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
      

      as the task is processed twice and the second time it doesn't exist in the database anymore.

      I did some debugging to find out how this happens. Basically what happens is that documents like Document Scheduler.NotificationEmailDailySender are updated before the tasks are read from the database. This means that the update event writes a task to the database and then this very same task is read back into the queue during the initialization. I suspect a similar issue could also happen if a document is saved twice with the same version which would create two tasks in the queue but just one in the database if the first task hasn't been finished before the second one is added. In this case the second task would also be lost if the processing is stopped during its execution.

        Attachments

          Activity

            People

            Assignee:
            mleduc Manuel Leduc
            Reporter:
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: