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.