Deleted Undead Scheduler Queue Entries

 

Sometimes, I've had a rule that fails continually, because data on it is bad.

Maybe it was created in development, maybe it's just gone rogue—data with a broken-off arrowhead lodged in its side, tearing through trees until, foam crusting its lips, it lays down to die.

Here's what I would do. First, poke around in the queue table in the db. You can also get valuable info from the rules_scheduler table.

I would set a breakpoint in common.inc in drupal_cron_run() right where $queue->claimItem() happens. I couldn't get cron to trigger breakpoints from the CLI (despite normally being able to use xdebug from the CLI but whatever), so went to /devel/php and ran drupal_cron_run();.

I got information about that cron entities that were stuck, and I deleted them from devel/php:

$queue = DrupalQueue::get('my_queue_name');
while ($item = $queue->claimItem()) {
//  kpr(date('m/d/Y', $item->data['date']));
  if ($item->data['date'] < time() && $item->data['config'] == 'my_config_set_i_want_to_die') {
    $queue->deleteItem($item);
    dpm ($item->data['config']);
  }
}

Yeah, it's not pretty. But what in this life is? Children? A gin and tonic with double gin? A dragon stretched out in full flight? If those are the things you want so bad, find another line of work.

About the Author

Hi. My name is Jeremiah John. I'm a sf/f writer and activist.

I just completed a dystopian science fiction novel. I run a website which I created that connects farms with churches, mosques, and synagogues to buy fresh vegetables directly and distribute them on a sliding scale to those in need.

In 2003, I spent six months in prison for civil disobedience while working to close the School of the Americas, converting to Christianity, as one does, while I was in the clink.