Add job level locking in case multiple processes are trying to dequeue jobs.

dopry - January 10, 2008 - 06:18
Project:Job queue
Version:5.x-2.0
Component:Code
Category:feature request
Priority:normal
Assigned:dopry
Status:needs work
Description

This patch depends on http://drupal.org/node/208286.

This patch adds a locked column to to the job_queue table and add a locked argument to job_queue_dequeue. When a job is dequeued the locked column will be set to the locked argument. You can use this to identify the called of job_queue_dequeue in the case you have multiple servers or processes handling the job queue.

#1

dopry - January 10, 2008 - 06:19
AttachmentSize
job_queue-locking.patch 2.15 KB

#2

dopry - January 10, 2008 - 06:22

here is an updated .test file to cover attempting to dequeue a locked job... It's hard to really test the feature, since you can't easily emulate concurrency within a test.

AttachmentSize
jobqueue.test 2.71 KB

#3

drumm - July 21, 2008 - 01:13
Status:needs review» needs work

The code has changed a bit in Drupal 6.

I would like to use this opportunity to add more information to the queue UI. The job status could be added to admin/reports/job_queue which says that the job is running, and for how long.

 
 

Drupal is a registered trademark of Dries Buytaert.