Queued jobs in redis backend are orphaned if Gearman server dies
This bug report was converted into a question: question #509172: Queued jobs in redis backend are orphaned if Gearman server dies.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gearman |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When using Redis as the persistence backend, queued jobs are set in Redis like so:
1466949136.176673 [0 127.0.0.1:61635] "SET" "_gear_
redis-cli info | grep db0
-> db0:keys=
(echo 'status'; sleep 0.1) | nc 127.0.0.1 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?
Changed in gearmand: | |
status: | New → Invalid |
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.
https:/ /github. com/gearman/ gearmand/ commit/ 40028f8ba1a1d4f 610a55a6d0a0868 3525372483# diff-7580c1cc38 95914f180088198 d7f8c92R255
This is the fix, you might need to just update to the latest version.