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.

hosting queued settings form.

Then, if there are no tasks but the queue is locked:

queue is locked.

Then on the confirm form:

queue button

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Pugh created an issue. See original summary.

  • Jon Pugh committed 10a6681 on 3017735-unlock-queue-ui
    Issue #3017735 by Jon Pugh: Add a UI to clear the semaphore for "...
Jon Pugh’s picture

Jon Pugh’s picture

Status: Active » Needs review
helmo’s picture

I'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.

Jon Pugh’s picture

Right 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.

helmo’s picture

Status: Needs review » Reviewed & tested by the community

OK

Tested with: drush @hm sql-query "insert into semaphore set name='hosting_queue_tasks_running', value=1;"

Jon Pugh’s picture

My 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.

  • Jon Pugh committed 10a6681 on 7.x-3.x
    Issue #3017735 by Jon Pugh: Add a UI to clear the semaphore for "...
Jon Pugh’s picture

Status: Reviewed & tested by the community » Fixed

Thanks helmo!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.