Looking for help on how to debug Scheduled task failed: Forum mailings and maintenance jobs (mod_forum\task\cron_task),error/locktimeout error.
We have a very large system and are running the forum task every minute, which was fine for years but recently began halting with the above error. The number of queries the task reports executing before halting is in the 500 000 range.
This comment https://tracker.moodle.org/browse/MDL-50719?focusedCommentId=452880&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-452880 suggests there are 4 reason for a locktimeout error
1.The previous cron tick process is still running that particular task which is taking ages
2.Another cron process on this box, or another box is running that task already
3.Some combination of the above
4.The locking mechanism is busted and the lock is stale
We are not sure how to debug or identify the cause of the lock time out. If we have so many forum posts to process that the task is taking too long to run (option 1 from above), how would we identify that? Is there some type of max execution time on tasks? Obviously we need all posts to be processed and reducing their quantity is not an option.
Looking for any help on debugging this error. Moodle version 3.5.