Problem/Motivation

When a scheduled update is run and is invalid, there is a field option to requeue the update.

Currently, if the update is requeued the item never runs again because of the condition in BaseUpdateRunner::addActiveUpdateConditions() having a commented out STATUS_REQUEUED.

Using WBM as an example: if I have a 3 step workflow, and the update runs when the node is in a state that can't transition to the value in the scheduled update, the transition is considered invalid so won't run.

If the node then gets transitioned to a valid from state, the update should run again.

I've tried uncommenting that line, but it doesn't fix the issue.

This is due to the update still referencing the old revision id, so $entities_to_update = $this->loadEntitiesToUpdate($entity_ids); returns an empty array.

Proposed resolution

Allow items to be requeued.

Comments

acbramley created an issue. See original summary.

acbramley’s picture

Issue summary: View changes
acbramley’s picture

More information from debugging with the entity id issue:

* I uncommented the line in BaseUpdateRunner::addActiveUpdateConditions() to include STATUS_REQUEUED items
* When running updates that get the requeued updates, and those requeued updates reference a node which has had a new revision since it was requeued:

BaseUpdateRunner::addUpdatesToQueue() correctly adds an update to the queue with the new revision ID.
When BaseUpdateRunner::runUpdatesInQueue() calls $queue->claimItem(), the $update_info array contains the old revision id.

This then fails to load the nodes in LatestRevisionUpdateRunner::loadEntitiesToUpdate

This causes the update to successfully run, but nothing happens.

acbramley’s picture

StatusFileSize
new1.35 KB

This makes the requeuing work, definitely not optimal but works.

acbramley’s picture

StatusFileSize
new1.59 KB

We need to remove requeued/invalid items from the queue. I ran this patch for a while and the queue ended up with 1500+ items in it so it would never reach the valid items.

acbramley’s picture

Status: Active » Needs review

  • smustgrave committed 5322b30d on 3.0.x
    feat: #2738079 Allow scheduled updates to be requeued
    
    By: acbramley
    
smustgrave’s picture

Version: 8.x-1.x-dev » 3.0.x-dev
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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