Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

I’m slightly mystified by this documentation: https://metacpan.org/pod/Gearman::Client.

There's a command_timeout option which can be passed:

command_timeout

Maximum time a gearman command should take to get a result (not a job timeout)

default: 30 seconds

What is the result in question if it's not a response from the command-line job Gearman is running?

  • Comment on What does Gearman's 'command_timeout' option control?

Replies are listed 'Best First'.
Re: What does Gearman's 'command_timeout' option control?
by Fletch (Bishop) on Dec 13, 2022 at 07:50 UTC

    Not familiar with gearman or that module but from skimming the docs and code my take is that's a timeout for hearing a response back from asking gearman to start something as opposed to a timeout on the work you’re asking it to do. Terrrible analogy follows which may not be even relevant; but my impression is that it's kind of like the difference between expecting your waiter to take your order promptly (the command timeout) and how long it takes the kitchen to actually make the order once the waiter delivers it (a timeout on the job itself).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: What does Gearman's 'command_timeout' option control?
by Discipulus (Canon) on Dec 13, 2022 at 08:02 UTC
    Hello Cody Fendant,

    the documentation is really poor.. For the little I understood this command_timeout is an internal timeout for gearman protocol, like assigning task to worker, get resutls etc. If this is true is poorly described.

    this github issue shows command_timeout was also undocumented up to 2018.

    Also gearman.org documentation is not so explicit.

    But using the source (Luke!) you can see $self->client()->{command_timeout} used as argument of the internal call to _wait_for_packet which then call Gearman::Util::read_res_packet which smell to me of internal protocol, not the meat of a job passed by your client.

    There is a DEBUG flag you can set somwhere (tired by poor documentation, sorry), or probably a --verbose option. See other ENV vars that can be used to have more fun experimenting with your command_timeout option.

    ..then please submit a PR to the documentation :)

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.