When a scheduled task fails, it retains the lock and further scheduled runs will fail because it cannot acquire a lock.
When a scheduled task fails, it should be logged, it should have the Times Failed increased, and the lock should be released so that on the next scheduled run, it can run again
The task is permanently locked and a "running" icon is displayed in the admin console.
{
"success": true,
"message": null,
"messages": null,
"data": {
"message": "could not acquire lock on task. retry or allow concurrency."
}
}
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-12-28 11:50:28 |
Closed_By | ⇒ | PhilETaylor |
If a task fails - like this
Status | Closed | ⇒ | New |
Closed_Date | 2021-12-28 11:50:28 | ⇒ | |
Closed_By | PhilETaylor | ⇒ |
the way I read that thread, Nics point is about unlocking running tasks, not failed tasks.
If a task fails, it is no longer running, you should release the lock and report the failure, allowing the task to run again (and maybe succeed) at a later schedule. All cron job systems do this.
the way I read that thread, Nics point is about unlocking running tasks, not failed tasks.
If a task fails, it is no longer running, you should release the lock and report the failure, allowing the task to run again (and maybe succeed) at a later schedule. All cron job systems do this.
Absolutely, and failed tasks are unlocked. We just have a few scenarios not covered so we aren't catching exceptions where we should be catching them. I'll work on fixing this soon so you can test.
ok cool - so the failure case I provided a useful one then
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-07 18:36:06 |
Closed_By | ⇒ | PhilETaylor |
hi
i have similar problem. i get this error:
{
"success": true,
"message": null,
"messages": null,
"data": {
"message": "could not acquire lock on task. retry or allow concurrency."
}
}
i change the
Scheduler config > Task Timeout
to 10 sec, but not any effect. i use shared hosting and can not check linux cron report.
how to resolve the problem?
i use joomla version 5.0.0
Thanks for opening this issue. Originally, we were doing auto-recovery of "locked" tasks running beyond a set timeout (Scheduler config > Task Timeout). With the conversation from joomla-projects/soc21_website-cronjob#39, it was decided it's not such a good idea.
Normally, these perma-blocking locked tasks requiring manual checks are only possible if a task crashes the parent process or similar. However, I can see we still have edge cases we are not accounting for and recovering the locks.
I'm guessing you got this lock as a result of an orphaned task (#36436)? Can you share some more information?