-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception during ADO ingest queue item processing causes the queue to be stuck. #221
Comments
@patdunlavey could you share what generated the exception? |
I really am not sure! Initial thought was bad character encoding, but I actually think it was strings in the csv that were not intended as json encoded, but were decoded as valid json. |
@patdunlavey the link to the try/catch you shared is the Live Queue (Ajax/Realtime). If a template fails to render an array {{ myarray }} in Drupal 10.2.8+, because of https://www.drupal.org/project/drupal/issues/3427177#comment-15754054 will inside the background queue worker here throw an unhandled exception at ami/src/Plugin/QueueWorker/IngestADOQueueWorker.php Lines 329 to 343 in d389b63
Lines 2473 to 2478 in d389b63
And then trigger an automatic re-enqueueing the Drupal's internal queue magic (on any exception) and the type will depend on the actual type of queue (DB one will not push immediately in the same place... I think) but others might ... I can make a work around there an try/catch the actual template rendering but ideally we should also tackle the issue that with the new Drupal Core change (good for the tests) render array validation will cancel a complete template rendering and that can be only resolved by working with Drupal core so they add a catch/try on their invocation code on the overridden default Twig Filter Drupal provides, OR, we override that filter (code duplication) and to it ourselves until someone else notices this is an issue. |
Solved via f8e42ac |
If an exception is encountered during
ami_ingest_ado
queue processing (specifically, inside the "try-catch" section) in\Drupal\ami\AmiBatchQueue::takeOne
, the problematic queue item is not removed from the queue and is picked up again to be processed again. This causes the queue to become permanently stuck on that item if the exception repeats every time the queue processor attempts to process it. The only solution is to manually go in (assuming you're using drupal database for queue management and not redis) and manually delete the offending queue item.We've seen an AMI ingest queue get stuck for several days before anybody notices (e.g. over a holiday weekend)! We've seen AMI update queues repeatedly generate new revisions for objects over and over, hundreds of times. (It would seem that the queue item is hitting an exception after the ADO has been updated.)
If the exception type is "RequeueException" or "SuspendQueueException", the lease is released, making the item become immediately first in line to be processed again. Other exceptions simply keep the item leased until the lease expires, and then they're ready to process it again.
Perhaps this makes sense for "RequeueException" - assuming that whichever place threw the exception has a valid reason for determining that the item should be re-enqueued (so hard to follow in the code!). I can't see the logic for keeping an item in the queue for any other kind of exception.
Thoughts:
The text was updated successfully, but these errors were encountered: