Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
18.8.0
-
None
-
Unknown
-
Description
Problem
At each startup, the Scheduler plugin restores the jobs from their pages (the XWiki.SchedulerJobClass objects) of every wiki. The scheduler keeps its jobs in memory, so all of them are new for it at startup, and in that case SchedulerPlugin#scheduleJob saves the status of the job (Normal or Paused) in the job page, even when the page already holds that status.
Saving the same value is not a no-op: setting the value of a property marks the object as modified, so each of these saves creates a new version of the job page. Every job page gets a new version at every startup (on every cluster member running the scheduler), without any change, and each save notifies the document update listeners.
In addition, these saves are meant to be minor edits, but XWiki#saveDocument(XWikiDocument, XWikiContext) resets the minor edit flag set on the document, so each of them creates a major version (1.1, 2.1, 3.1, and so on). The same happens to the save done when the execution context of a job (user, language, wiki) is filled the first time the job is scheduled.
XWIKI-8162 fixed the same symptom in 4.2. The code was read on 18.8.0 and the behaviour is older than this version.
Proposal
- Save the status of the job only when it differs from the status stored in the job page.
- Save the job page as a minor edit, as intended, by passing the minor edit flag to XWiki#saveDocument.
Attachments
Issue Links
- is related to
-
XWIKI-25262 Run the scheduler on a single cluster member and move it when that member leaves
-
- Open
-
- relates to
-
XWIKI-8162 Scheduler jobs shouldn't be updated in the database when it's not needed
-
- Closed
-