Problem/Motivation

Currently if the queue is empty, the processor will stop. It would be nice if we could control whether the processor should do that or not.

Add a stop when empty configuration that defaults to TRUE to ensure BC.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#6 3275594-6.patch5.08 KBjsacksick
#2 3275594-2.patch4.71 KBjohnwebdev

Comments

johnwebdev created an issue. See original summary.

johnwebdev’s picture

Status: Active » Needs review
StatusFileSize
new4.71 KB
jsacksick’s picture

That was actually the behavior in the 7.x version, if I'm not mistaken, it was acting like a "daemon" that would keep running in the background.

Maybe we should make the option more explicit? "Daemonize", with a description that reads: "Keep the processor running in the background even if there are no jobs to process"

Thoughts?

jcnventura’s picture

Seems like #3133969: Restore `timeout` option for Drush command also uses a daemon approach but with a configurable timeout (set to 90 seconds by default).

Seems like that solution would be a better option.

mglaman’s picture

The one problem with #3133969: Restore `timeout` option for Drush command is that an empty queue will cause a daemonized runner to keep restarting the command over and over and over again instead of periodically if the queue is empty.

If the queue is empty, the command will quit. Then it will be run again. I'm not sure if this good or bad.

jsacksick’s picture

StatusFileSize
new5.08 KB

Will give this patch a try, patch had to be re-rolled.

jsacksick’s picture

Status: Needs review » Reviewed & tested by the community

I think this is good to go, this has been in use in 5 different production websites for 2 months.

jsacksick’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks @johnwebdev!

  • jsacksick committed e3272228 on 8.x-1.x
    Issue #3275594 by johnwebdev, jsacksick: Allow processor to keep running...
bojanz’s picture

I honestly don't see why the processor should every quit when the queue is empty. I know we originally implemented it that way, but I have no recollection why. Most other queue processors will sleep for a configurable amount of seconds, then try to claim a job again.

Status: Fixed » Closed (fixed)

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