runbot/forwardport/models
Xavier Morel d4cb314e8f [IMP] forwardport: behaviour and reliability of queue crons
The queueing system clearly tried to mitigate the time delay from the
old cron style while trying to make things safe-ish. However this
probably is unnecessary (and might be harmful) thanks to cron
triggers: instead of processing a batch of records from the queue we
can just process one record, then trigger the cron, until we don't
find any record anymore. This means every cron run is much
shorter (doesn't try to process 10~100 elements per loop) and should
be way more reliable as they're all isolated, with some overhead to
pay. A cron with a long queue also should not lock up a worker for
quite as long.

This means on server shutdown, the crons should just try to finish
their current item (which hopefully doesn't take too long even for a
multi-stage update) and once that's done allow for the cron worker to
see the shutdown request.

Also remove the mostly unnecessary exclusive lock on queue records:
the cron system itself guarantees a given cron job only gets run by
one worker at a time, so there should be no concurrent access to a
job (except for trying to unlink a previously enqueued record I
guess).

Should limit the risks of #1085 repeating assuming it was caused by an
abrupt termination after 90s.
2025-03-13 15:19:51 +01:00
..
__init__.py [ADD] runbot_merge: ~~tree~~ freeze wizard 2021-11-17 10:40:12 +01:00
forwardport.py [IMP] forwardport: behaviour and reliability of queue crons 2025-03-13 15:19:51 +01:00
project_freeze.py [REM] forwardport: re-enablement of forward ports when closing wizard 2025-02-18 11:45:56 +01:00
project.py [IMP] *: avoid updating (all) branches in cases where that's unnecessary 2025-03-07 09:15:48 +01:00