Queued jobs in redis backend are orphaned if Gearman server dies

Asked by Danny Kopping on 2016-06-26

When using Redis as the persistence backend, queued jobs are set in Redis like so:

1466949136.176673 [0] "SET" "_gear_-process-job-fdaa984bed6075f02e9971734e57c20f260a704d\x00\x00\x00" "workload"

redis-cli info | grep db0

-> db0:keys=1,expires=0,avg_ttl=0

(echo 'status'; sleep 0.1) | nc 4730

-> process-job 1 0 0

This shows there is 1 job in the queue, and that job is stored in Redis - all fine at this point.

Now, let's say the Gearman server is killed for whatever reason... When Gearman starts up again, it doesn't know about these queued jobs and they are effectively "orphaned".

Is there a workaround for this?

Question information

English Edit question
Gearman Edit question
No assignee Edit question
Last query:
Last reply:
Kiril Angov (kiril.angov) said : #1

There is a pretty nasty bug in the Redis "persistence" which pretty much makes this plugin a noop. You put stuff in but it can never replay them because there is an error in the KEYS command it uses for replaying from Redis.


This is the fix, you might need to just update to the latest version.

Can you help with this problem?

Provide an answer of your own, or ask Danny Kopping for more information if necessary.

To post a message you must log in.