I've seen this recently, and I think I've found the problem.
The bug is more likely to appear with the system cron being called more often (in my case, every five minutes).
It seems that
cron_runner_listener (phpbb/cron/event/cron_runner_listener.php) is being called at the end of some Forum requests, even though I've set phpBB to use system cron.
In the
on_kernel_terminate() method, a "cron_lock" lock is acquired, but only released if a task is found to be processed.
This code is wrong:
Code: Select all
if ($this->cron_lock->acquire())
{
$task = $this->cron_manager->find_task($cron_type);
if ($task)
{
if ($task->is_parametrized())
{
$task->parse_parameters($this->request);
}
if ($task->is_ready())
{
$task->run();
}
$this->cron_lock->release();
}
}
It should release the lock even if no task is found:
Code: Select all
if ($this->cron_lock->acquire())
{
$task = $this->cron_manager->find_task($cron_type);
if ($task)
{
if ($task->is_parametrized())
{
$task->parse_parameters($this->request);
}
if ($task->is_ready())
{
$task->run();
}
}
$this->cron_lock->release();
}
or, even better, this listener should not be called if system cron is being used.