Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The hosting queue can get stuck if a task craps out before finishing, which leaves a stray entry in the "semaphore" table.
This patch provides a UI to the admin/hosting/queued page when the hosting_queue_tasks_running lock is set but there are no processing tasks.
It provides a page with a single button that will remove the lock, and adds a "Tasks Running" indicator to the hosting queue daemon settings form.
Then, if there are no tasks but the queue is locked:
Then on the confirm form:
Comment | File | Size | Author |
---|---|---|---|
#3 | 3017735-unlock-queue-ui.patch | 4.22 KB | Jon Pugh |
Screenshot from 2018-12-03 12-03-51.png | 13.77 KB | Jon Pugh | |
Screenshot from 2018-12-03 12-02-57.png | 13.31 KB | Jon Pugh | |
Screenshot from 2018-12-03 12-01-54.png | 51.53 KB | Jon Pugh |
Comments
Comment #3
Jon PughComment #4
Jon PughComment #5
helmo CreditAttribution: helmo at Initfour websolutions for DNV GL commentedI'm not sure I understand when this works.
The semaphore could be left behind when a task suffers a fatal error.... but then it also still has the HOSTING_TASK_PROCESSING status.
Or do you have another scenario?
I just tried to simulate an error by adding a 'die' statiement in drush_provision_drupal_provision_verify_validate() but that was properly handled.
Comment #6
Jon PughRight now it's happening in the devshop install.sh script. Somehow, the sudo privileges don't seem to have been reloaded, so it hangs asking for a sudo password. You have to CTRL-C, and that leaves the semaphore...
I can't remember the exact cause of it, but I've seen it happen other times as well.
The main thing is, this is one of 3 or so answers to the common question of "why won't my tasks run".
It only activates in the edge case when the semaphore exists but there are no processing tasks.
Comment #7
helmo CreditAttribution: helmo at Initfour websolutions for DNV GL commentedOK
Tested with:
drush @hm sql-query "insert into semaphore set name='hosting_queue_tasks_running', value=1;"
Comment #8
Jon PughMy goal is to make aegir/devshop more self-healing. There's no reason we can't surface these problems for the user.
I want to put it into a hook_requirements as well, so the drupal site status knows about it, but that can be a follow up.
Comment #10
Jon PughThanks helmo!