[zeromq-dev] C Based ZeroMQ Aggregation Server Problems...

Henry Geddes hgeddes at zynga.com
Tue Oct 18 00:40:09 CEST 2011


Ok so we tried our stupider code:

  4 #include "zhelpers.h"
  5 #include <stdio.h>
  6
  7 int main () {
  8     //s_version ();
  9
 10     void *context = zmq_init (1);
 11
 12     // Sink socket
 13     void *sink = zmq_socket (context, ZMQ_PULL);
 14     zmq_bind (sink, "tcp://*:5565");
 15
 16     // Pub socket
 17     void *publisher = zmq_socket (context, ZMQ_PUB);
 18     zmq_bind (publisher, "tcp://*:5566");
 19
 20     while (1) {
 21         // Read message contents
 22         char *contents = s_recv (sink);
 23         if (strlen(contents)) s_send(publisher, contents);
 24         free (contents);
 25     }
 26     // We never get here but clean up anyhow
 27
 28     zmq_close (publisher);
 29     zmq_close (sink);
 30     zmq_term (context);
 31     return 0;
 32 }

We checked out the master branch and have tested with that.  We have not seen the unhandled error.  We have had this fall over once so far and currently are testing to see if it does again.

-----Original Message-----
From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Pieter Hintjens
Sent: Monday, October 17, 2011 2:36 PM
To: ZeroMQ development list
Subject: Re: [zeromq-dev] C Based ZeroMQ Aggregation Server Problems...

On Mon, Oct 17, 2011 at 4:23 PM, Ian Barber <ian.barber at gmail.com> wrote:

>> I have noticed this error "E: unhandled error on recv: 11/Resource temporarily unavailable" but it does not seem to correlate with the issue.
>
> Ah, that's interesting - Pieter is this related the nbytes == 1 fix
> you put in recently? Henry, could you possibly try this against
> zeromq2-1 master?

Yes, the message will appear randomly but have no other effect afaik.
I'll make a new stable release pretty soon.

Henry,

You don't need to be doing zero-copy here: just recv the message on
one socket, send it on the other, then close it. No copying will
happen. Zero-copy is useful when sending large application buffers.

Do you know if the sink blocks when receiving off the PULL socket?
This sounds like a bug, I can't think of any normal condition that
would cause this. Can you confirm where the sink process is blocked?

-Pieter
_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list