[zeromq-dev] Guide Example Runner

john skaller skaller at users.sourceforge.net
Mon Jan 30 00:08:12 CET 2012


Here's some test output:

////////////////
~/felix>./launch test/zmq/
http://zguide.zeromq.org/page:all#Ask-and-Ye-Shall-Receive
[hwserver] Process Monitoring pthread for test/zmq/hwserver start at 1327876683
[hwclient] Process Monitoring pthread for test/zmq/hwclient start at 1327876683
[hwclient] Process 879 created for program test/zmq/hwclient
[hwserver] Process 880 created for program test/zmq/hwserver
hwclient, Felix version
Connecting to hello world server
Sending Hello 0
hwserver, Felix version
Received Hello=Hello
Received World 0=World
Sending Hello 1
Received Hello=Hello
Received World 1=World
Sending Hello 2
Received Hello=Hello
Received World 2=World
Sending Hello 3
Received Hello=Hello
Received World 3=World
Sending Hello 4
Received Hello=Hello
Received World 4=World
Sending Hello 5
Received Hello=Hello
Received World 5=World
Sending Hello 6
Received Hello=Hello
Received World 6=World
Sending Hello 7
Received Hello=Hello
Received World 7=World
Sending Hello 8
Received Hello=Hello
Received World 8=World
Sending Hello 9
Received Hello=Hello
Received World 9=World
[hwclient] Exit 879 status 0
[hwclient] Monitoring pthread for test/zmq/hwclient done finish at 1327876695
Funeral of hwclient
[hwclient] Signalled DEAD for test/zmq/hwclient
[hwserver] KILL: Process 880 for test/zmq/hwserver exceeded time limit 20
[hwserver] Exit 880 status 9
[hwserver] Monitoring pthread for test/zmq/hwserver done finish at 1327876705
Funeral of hwserver
Finished with group http://zguide.zeromq.org/page:all#Ask-and-Ye-Shall-Receive
--------------------
http://zguide.zeromq.org/page:all#Version-Reporting
[hwserver] Signalled DEAD for test/zmq/hwserver
[version] Process Monitoring pthread for test/zmq/version start at 1327876705
[version] Process 881 created for program test/zmq/version
Current 0MQ version is 3.1.1
[version] Exit 881 status 0
[version] Monitoring pthread for test/zmq/version done finish at 1327876707
Funeral of version
Finished with group http://zguide.zeromq.org/page:all#Version-Reporting
--------------------
[version] Signalled DEAD for test/zmq/version
http://zguide.zeromq.org/page:all#Getting-the-Message-Out
[wuserver] Process Monitoring pthread for test/zmq/wuserver start at 1327876707
[wuserver] Process 882 created for program test/zmq/wuserver
[wuclient1] Process Monitoring pthread for test/zmq/wuclient start at 1327876707
Collecting updates from weather server...
[wuclient2] Process Monitoring pthread for test/zmq/wuclient start at 1327876707
[wuclient2] Process 884 created for program test/zmq/wuclient
[wuclient3] Process Monitoring pthread for test/zmq/wuclient start at 1327876707
Collecting updates from weather server...
[wuclient3] Process 885 created for program test/zmq/wuclient
[wuclient1] Process 883 created for program test/zmq/wuclient
Collecting updates from weather server...
[wuserver] KILL: Process 882 for test/zmq/wuserver exceeded time limit 20
[wuclient2] KILL: Process 884 for test/zmq/wuclient exceeded time limit 20
[wuclient3] KILL: Process 885 for test/zmq/wuclient exceeded time limit 20
[wuclient1] KILL: Process 883 for test/zmq/wuclient exceeded time limit 20
[wuserver] Exit 882 status 9
[wuserver] Monitoring pthread for test/zmq/wuserver done finish at 1327876729
[wuclient2] Exit 884 status 9
[wuclient2] Monitoring pthread for test/zmq/wuclient done finish at 1327876729
[wuclient3] Exit 885 status 9
[wuclient3] Monitoring pthread for test/zmq/wuclient done finish at 1327876729
Funeral of wuclient3
[wuclient3] Signalled DEAD for test/zmq/wuclient
[wuclient2] Signalled DEAD for test/zmq/wuclient
Funeral of wuclient2
[wuclient1] Exit 883 status 9
[wuclient1] Monitoring pthread for test/zmq/wuclient done finish at 1327876729
Funeral of wuclient1
[wuclient1] Signalled DEAD for test/zmq/wuclient
[wuserver] Signalled DEAD for test/zmq/wuserver
Funeral of wuserver
Finished with group http://zguide.zeromq.org/page:all#Getting-the-Message-Out
----------------------
///////////////

The "launch" program segfaults regularly: this is a bug in the Felix system (probably
the run time libraries) I have to fix that :)

The above monitor shows the Hello World programs are working.
However the weather client/server do not work correctly: 
I believe this is a bug in 0MQ. Already reported. It's a synchronisation error.

Here's another run:

//////////////
http://zguide.zeromq.org/page:all#Getting-the-Message-Out
[version] Signalled DEAD for test/zmq/version
[wuserver] Process Monitoring pthread for test/zmq/wuserver start at 1327877297
[wuserver] Process 919 created for program test/zmq/wuserver
[wuclient1] Process Monitoring pthread for test/zmq/wuclient start at 1327877297
[wuclient2] Process Monitoring pthread for test/zmq/wuclient start at 1327877297
[wuclient2] Process 921 created for program test/zmq/wuclient
[wuclient1] Process 920 created for program test/zmq/wuclient
[wuclient3] Process Monitoring pthread for test/zmq/wuclient start at 1327877297
[wuclient3] Process 922 created for program test/zmq/wuclient
Collecting updates from weather server...
Collecting updates from weather server...
Collecting updates from weather server...
Average temperature for zipcode '1001' was 20 C

Average temperature for zipcode '1001' was 20 C

Average temperature for zipcode '1001' was 20 C

[wuclient2] Exit 921 status 0
[wuclient2] Monitoring pthread for test/zmq/wuclient done finish at 1327877299
[wuclient1] Exit 920 status 0
[wuclient1] Monitoring pthread for test/zmq/wuclient done finish at 1327877299
[wuclient3] Exit 922 status 0
[wuclient3] Monitoring pthread for test/zmq/wuclient done finish at 1327877299
Funeral of wuclient3
[wuclient3] Signalled DEAD for test/zmq/wuclient
[wuclient2] Signalled DEAD for test/zmq/wuclient
Funeral of wuclient2
[wuclient1] Signalled DEAD for test/zmq/wuclient
Funeral of wuclient1
[wuserver] KILL: Process 919 for test/zmq/wuserver exceeded time limit 20
[wuserver] Exit 919 status 9
[wuserver] Monitoring pthread for test/zmq/wuserver done finish at 1327877319
Funeral of wuserver
Finished with group http://zguide.zeromq.org/page:all#Getting-the-Message-Out
//////////

This one worked. Only the server needed to be killed.
We see the value of integration testing here.  The clients are hanging in the first run because
the server didn't get to bind the publish socket in time for the clients to subscribe,
so the subscriptions just hang. That's not supposed to happen.


Here's the weather service with a proxy:

/////////////////////
http://zguide.zeromq.org/page:all#A-Publish-Subscribe-Proxy-Server
[wuserver] Process Monitoring pthread for test/zmq/wuserver start at 1327877563
[wuserver] Process 938 created for program test/zmq/wuserver
[wuclient1] Process Monitoring pthread for test/zmq/wuclient start at 1327877563
[wuclient1] Process 939 created for program test/zmq/wuclient
Collecting updates from weather server...
[wuclient2] Process Monitoring pthread for test/zmq/wuclient start at 1327877563
[wuclient2] Process 940 created for program test/zmq/wuclient
[wupoxy] Process Monitoring pthread for test/zmq/wuproxy start at 1327877563
[wupoxy] Process 941 created for program test/zmq/wuproxy
[wuclient3] Process Monitoring pthread for test/zmq/wuclient start at 1327877563
Collecting updates from weather server...
Collecting updates from weather server...
[wuclient3] Process 942 created for program test/zmq/wuclient
[wuclient4] Process Monitoring pthread for test/zmq/wuclient start at 1327877563
[wuclient4] Process 943 created for program test/zmq/wuclient
Collecting updates from weather server...
Exit due to ZMQ error 49: Can't assign requested address
Average temperature for zipcode '1001' was 20 C

Average temperature for zipcode '1001' was 20 C

Average temperature for zipcode '1001' was 20 C

Average temperature for zipcode '1001' was 20 C

[wuclient1] Exit 939 status 0
[wuclient1] Monitoring pthread for test/zmq/wuclient done finish at 1327877565
[wuclient2] Exit 940 status 0
[wuclient2] Monitoring pthread for test/zmq/wuclient done finish at 1327877565
[wupoxy] Exit 941 status 12544
[wupoxy] Monitoring pthread for test/zmq/wuproxy done finish at 1327877565
[wuclient3] Exit 942 status 0
[wuclient3] Monitoring pthread for test/zmq/wuclient done finish at 1327877565
[wuclient4] Exit 943 status 0
[wuclient4] Monitoring pthread for test/zmq/wuclient done finish at 1327877565
Funeral of wuclient4
[wuclient4] Signalled DEAD for test/zmq/wuclient
[wuclient3] Signalled DEAD for test/zmq/wuclient
Funeral of wuclient3
[wupoxy] Signalled DEAD for test/zmq/wuproxy
Funeral of wupoxy
[wuclient2] Signalled DEAD for test/zmq/wuclient
Funeral of wuclient2
[wuclient1] Signalled DEAD for test/zmq/wuclient
Funeral of wuclient1
[wuserver] KILL: Process 938 for test/zmq/wuserver exceeded time limit 20
[wuserver] Exit 938 status 9
[wuserver] Monitoring pthread for test/zmq/wuserver done finish at 1327877585
Funeral of wuserver
Finished with group http://zguide.zeromq.org/page:all#A-Publish-Subscribe-Proxy-Server
//////////////////

The bad address is there because there's an inappropriate example
IP address in the proxy server.  To be fixed using command line arguments.
Other than that, the code seems to run: we got 4 weather summaries from
the 4 clients.

And here's Felix segfaulting:

http://zguide.zeromq.org/page:all#A-Request-Reply-Broker
[rrclient1] Process Monitoring pthread for test/zmq/rrclient start at 1327877585
[rrclient1] Process 944 created for program test/zmq/rrclient
[rrclient2] Process Monitoring pthread for test/zmq/rrclient start at 1327877585
[wuserver] Signalled DEAD for test/zmq/wuserver
[rrclient2] Process 945 created for program test/zmq/rrclient
[rrclient3] Process Monitoring pthread for test/zmq/rrclient start at 1327877585
[rrclient3] Process 946 created for program test/zmq/rrclient
Segmentation fault

The interaction of fibres, threads, the garbage collector, p-channels and
f-channels is a sophisticated exercise in multi-threading. The same technology
is used to "offline" blocking fibres on sockets: that seems to work: otherwise
the Felix webserver wouldn't run. Anyhow you're not interested in that,
but I just thought to show the state of the process manager here.

At this stage, the process manager probably needs a new feature to delay
after launching a server, to give it time to set up. Unfortunately, one of the tests
then expects the clients to start before the server sends messages.
This is rather tricky to organise and unrealistic in the real world, so perhaps
that test needs to be changed: the original code expects you to "push any key"
but that's not acceptable in a batch test environment (and it isn't clear 
if that would even work, having a child process trying to read stdin).


--
john skaller
skaller at users.sourceforge.net







More information about the zeromq-dev mailing list