-
Notifications
You must be signed in to change notification settings - Fork 30
Description
I found a situation where jobs time out if there is no payload. So executing this:
task = Gearman::Task.new("function_name", {a: "hi"}.to_json)(with all the other boilerplate stuff to send and get result) works but this
task = Gearman::Task.new("function_name")does not. This is for a foreground job and I have not tested on background jobs.
Also worth noting that the failure does not occur all the time. I have a job that executes every 15 minutes and very occasionally (once/week) it just "loses" it's connection to the Gearman server permanently. The client code is very simple (essentially does the aforementioned task of hitting a function with no payload). When the "connection loss" happens I usually hop in and restart the worker which solves everything but in this instance I wanted to debug the issue so I did not restart the worker and started tailing the server, client, worker logs and checked connections, etc.
Above is what I found and seems pretty conclusive. Sending no payload in some instances caused the job to not go through. Sending a payload always gets the job through.