db-scheduler: Task completion sometimes fails inside onCompleteReschedule

We’re running db-scheduler on 2 servers, with 1s polling interval and immediate execution enabled. I have about 10 jobs and from time to time some of them fail in the onCompleteReschedule step (5-10 times a day).

Failed while completing execution Execution: task=foo, id=recurring, executionTime=2019-11-14T09:00:00.454264Z, picked=true, pickedBy=bar-567f94488b-jmq9v, lastHeartbeat=2019-11-14T09:00:00Z, version=67910. Execution will likely remain scheduled and locked/picked. The execution should be detected as dead in PT4M, and handled according to the tasks DeadExecutionHandler.

java.lang.RuntimeException: Expected one execution to be updated, but updated 0. Indicates a bug.
	at com.github.kagkarlsson.scheduler.JdbcTaskRepository.rescheduleInternal(JdbcTaskRepository.java:196)
	at com.github.kagkarlsson.scheduler.JdbcTaskRepository.reschedule(JdbcTaskRepository.java:154)
	at com.github.kagkarlsson.scheduler.task.ExecutionOperations.reschedule(ExecutionOperations.java:38)
	at com.github.kagkarlsson.scheduler.task.CompletionHandler$OnCompleteReschedule.complete(CompletionHandler.java:50)
	at com.github.kagkarlsson.scheduler.Scheduler$PickAndExecute.complete(Scheduler.java:327)
	at com.github.kagkarlsson.scheduler.Scheduler$PickAndExecute.executePickedExecution(Scheduler.java:309)
	at com.github.kagkarlsson.scheduler.Scheduler$PickAndExecute.run(Scheduler.java:286)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (13 by maintainers)

Most upvoted comments

Will see if I can replicate the issue.