question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Task completion sometimes fails inside onCompleteReschedule

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
kagkarlssoncommented, Nov 14, 2019

Will see if I can replicate the issue.

0reactions
paulosuzartcommented, Oct 19, 2022

Hey folks. I got the same error using PgSQL + lock_and_fetch strategy. Not sure if it’s related to the strategy. PgSQL is just a regular Google Cloud SQL. I couldn’t determine what was going on. What we noticed is that the exceptions happened at times of deployment. If we find any new information, we will share it here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do we so often fail to complete the tasks that matter most ...
They both share similarities. Barriers related to advanced planning: 1. Visualizing the cost of time is hard. In some ways, time is like...
Read more >
c# - Fail to wait for Task completion - ASP.NET Web API ...
CompleteTask() is a dummy method which I created as a flag in the message processor class I have, which processes information messages received ......
Read more >
Don't confuse task completion with productivity
People who work remotely often claim to be 'more productive'. ... If you finish a task quickly, but then have to engage in...
Read more >
How to deal with a team that fails to complete a task?
First thing is to set intermediate milestones. If you measure task completion at task completion, you have already failed. There is no ...
Read more >
Setting error codes using the job completion checker - IBM
Sometimes the success or failure of a job or started-task operation cannot ... not want the operation representing the job to be marked...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found