Cool, is that open sourced somewhere? hachi and I were talking about
that the other day to reduce the runtime of a unit test suite.
Yann
Brian.
--------
http://brian.moonspot.net/
Real documentation for Gearman is on my short list of things todo,
still busy getting some of the core features running first. For now
the mailing list and IRC channel are the best ways to get answers. I
plan on having a collection of real docs (or at least a start) by
OSCON in July. Getting back to your specific question...
The C server can take multiple -v flags. The more you specify,
the more details you see. I usually use -vv when doing most of my
testing. I would also look at the admin commands as well. For example:
> gearmand -vv
Starting up
Initializing libevent for main thread
Method for libevent: epoll
Trying to listen on :::4730
Listening on :::4730 (6)
Trying to listen on 0.0.0.0:4730
Address already in use 0.0.0.0:4730
Creating wakeup pipe
Creating 0 threads
Creating IO thread wakeup pipe
Adding event for listening socket (6)
Adding event for wakeup pipe
Entering main event loop
You can see it bound to port 4730. When I start up a reverse_worker
process, I see:
Accepted connection from ::10a0:e301:0:0%31701584:51298
[ 0] ::10a0:e301:0:0%31701584:51298 Connected
This is how you can verify when a connection happens. Now I check
some status variables by telnet/nc to the job server port:
> nc localhost 4730
status
reverse 0 0 1
.
workers
12 ::10a0:e301:0:0%31701584 - :
11 ::10a0:e301:0:0%31701584 - : reverse
.
I ran the 'status' and 'workers' commands, see other
commands towards the bottom of the protocol document
(http://www.gearman.org/doku.php?id=protocol). There are two
connections: the reverse_worker and the telnet connection I just
made. The server knows about the "reverse" function, and shows no
jobs in queue and one worker connected. If I now run reverse_client,
I see another quick connect/disconnect:
Accepted connection from ::10a0:e301:0:0%31701584:39173
[ 0] ::10a0:e301:0:0%31701584:39173 Connected
[ 0] ::10a0:e301:0:0%31701584:39173 Disconnected
As for the Perl client/worker, I'm not quite as familiar. I can say
though that you probably won't get much from the worker because it's
perfectly ok for a job server to be down, the worker will just keep
trying to reconnect to all the servers in the list. The worker will
never error because of a failed connection. A client should fail if
it cannot connect though.
-Eric