Running long cron tasks
The running cron lock the cron table and when the cron task take a long time it creates issues like:
- prevent editing cron tasks
- prevent database update
We have also encounter that some managed database are closing the connection holding the lock after some time (about 1h) if there is no activity on the connection (even with keepalive option).
I propose to adapt the cron to use a design closer to the worker/queue. So the process will only take a lock on the cron record that is going to be run. The cron will be run with the same transaction. As the lock is per record there will be no need to limit the execution to only one cron process (this will ease implementing #13053).