Clearing adhoc task locks manually

Clearing adhoc task locks manually

by Mike Kelly -
Number of replies: 3

Hi there,

I'm running into an issue where for some reason Moodle isn't clearing adhoc tasks locks, which is preventing Moodle from sending outgoing mail. I'd like to do it manually, but I'm not 100% sure where to look ... but I have ideas wink

I'm running a Moodle cluster, v3.9.3 with a PostgreSQL 11 backend. There is a shared Redis instance, which is configured in config.php:

$CFG->lock_factory = '\\local_redislock\\lock\\redis_lock_factory';

So I'm going to assume that is where the adhoc task locks are being created and not in the database.

Below is an example of the errors I see in the Moodle cron log when the problem happens. Increasing the adhoc task concurrency limit in Moodle "fixes" the problem, until it recurs.

I'd like to go into Redis and clear out the offending task locks, assuming that's where they are. What should I be looking for? Are the key names just "mdl_tru_cron_adhoc_task_runner_0", "mdl_tru_cron_adhoc_task_runner_1", etc?

If so, can I just go ahead and delete them (assuming no cron tasks are running)?

Thanks!

----

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_0 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_0 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_1 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_1 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_2 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_2 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_3 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_3 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_4 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_4 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_5 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_5 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_6 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_6 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_7 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_7 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_8 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_8 lock

Redis lock; pid=133021; Waiting to get mdl_tru_cron_adhoc_task_runner_9 lock

Redis lock; pid=133021; Lock timeout, did not obtain mdl_tru_cron_adhoc_task_runner_9 lock

Skipping processing of adhoc tasks. Concurrency limit reached.



Average of ratings: -
In reply to Mike Kelly

Re: Clearing adhoc task locks manually

by Mike Kelly -
Anybody? It'd be nice to clear out these old task locks rather than continuing to bump up the adhoc task limit ... (and the next step will be to figure out why some of these task locks are hanging around)
In reply to Mike Kelly

Re: Clearing adhoc task locks manually

by Jerry Lau -
In reply to Jerry Lau

Re: Clearing adhoc task locks manually

by Mike Kelly -
Thanks Jerry - I was hoping to be more selective and avoid flushing the entire cache so I didn't take out sessions too. But that will be my fall-back.