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
Issue Links
- causes
-
XWIKI-21820 If two identical tasks are queued at the same milisecond and exception is thrown
- Open