[TASKMGMT-38] Scheduler discards all scheduled publications on restart Created: 20/Jan/20  Updated: 19/Mar/20  Resolved: 28/Feb/20

Status: Closed
Project: Task Management
Component/s: None
Affects Version/s: 1.2.7
Fix Version/s: 1.2.7

Type: Bug Priority: Critical
Reporter: Richard Gange Assignee: Sang Ngo Huu
Resolution: Fixed Votes: 0
Labels: groovy, publication, scheduler, workflow
Remaining Estimate: 0d
Time Spent: 6.75d
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Relates
relates to MGNLSCH-64 Scheduler discards all programaticall... Closed
relation
is related to TASKMGMT-36 Scheduled pages don't publish if sche... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Support
Sprint: 6.2 Ramp-up 16, 6.2 Ramp-up 17, 6.2 Ramp-up 18
Story Points: 13

 Description   

Steps to reproduce:

  • Scheduled a page to be published in 2 minutes.
  • Change a configuration on the scheduler module. (aka restart the module)
  • Observe the page is never published.


 Comments   
Comment by Richard Gange [ 20/Jan/20 ]

You can workaround the issue by calling the following groovy script after making changes to the scheduler module.

import info.magnolia.task.TasksManager
import info.magnolia.task.schedule.TaskSchedulerService
import info.magnolia.objectfactory.Components
import info.magnolia.task.Task
import java.util.Arrays

tm = Components.getComponent(TasksManager)
tss = Components.getComponent(TaskSchedulerService)

tasks = tm.findTasksByStatus(Arrays.asList(Task.Status.Scheduled))
tss.schedule(tasks)
println "tasks rescheduled"
Comment by Mikaël Geljić [ 03/Feb/20 ]

Tentatively regarding this as a workflow / scheduled-publication specific issue. Most other jobs which are registered programmatically would normally be throwaway.

Comment by Mikaël Geljić [ 04/Feb/20 ]

And (thanks to Espen), task-management module does this upon startup; except that module doesn't restart when scheduler does— 
see https://git.magnolia-cms.com/projects/MODULES/repos/task-management/browse/src/main/java/info/magnolia/task/TaskManagementModule.java#100
 
Do we need additional observation onto scheduler module config or even onto quartz initialization somehow?

Comment by Richard Gange [ 04/Feb/20 ]

Since you moved this to WKFL I thought we would look for a solution there. I would propose that the workflow module should have an observation on the scheduler config here: /modules/scheduler/config/jobs.

Comment by Mikaël Geljić [ 28/Feb/20 ]

We now restore scheduled tasks through a SchedulerListener's #schedulerStarted hook, leveraging support for persisting global listeners from MGNLSCH-64.

Generated at Mon Feb 12 11:02:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.