Automattic / Cron-Control

A fresh take on running WordPress's cron system, allowing parallel processing

Home Page:https://wordpress.org/plugins/wp-cron-control/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lock: locks can deadlock if event times out or fatals

ethitter opened this issue · comments

Related to #105, if an event callback fatals, or exceeds the allotted time, the locks set for it won't be cleared. Over time, this can lead to the number of available "slots" being reduced as the lock will indicate that other events are occupying slots, when they really aren't.

Perhaps the lock should hold a timestamp for each slot, instead of the lock-wide timestamp used now.

try-catch will work for this with PHP 7+, but there's no good way to catch a fatal in prior versions. Even with a custom error handler (via set_error_handler()), prior to 7, code execution still stops.

http://php.net/manual/en/language.errors.php7.php