[zeromq-dev] (py)zmq PUSH/PULL, freebsd, kqueue error

Gábor Farkas gabor.farkas at gmail.com
Mon Oct 17 10:59:52 CEST 2011


hi,

i have an application in python, using PUSH/PULL zmq sockets, on freebsd.

sometimes the process with the PUSH socket dies with this message:

Exception zmq.core.error.ZMQError: ZMQError() in
<zmq.core.socket.Socket object at 0x80d0c12b8> ignored
Bad file descriptor
rc != -1 (kqueue.cpp:67)

the package-versions are:
zmq-2.1.7
py26-pyzmq-2.1.1
freebsd-8.2

the config in more detail:

i'm pushing logging-data from worker-processes (around 100 processes)
to a central logging server.
the behavior i want is that if the PUSH-socket cannot push, it should
drop the data (for me it's better to lose log-data than to lock up the process).

so i'm using zmq.NOBLOCK, like this:

        try:
            s.send(data,zmq.NOBLOCK)
        except zmq.core.error.ZMQError,e:
            pass

currently the PULL-part is not activated, so there is no PULL socket
anywhere, so all the log-data is dropped (that is fine for me). also,
this has been running for days.

any ideas what might cause the problem? perhaps something overflows in
zeromq if it cannot connect to the other end for a long time?

p.s: originally i wanted to do this with PUB/SUB, because that seemed
like the correct architecture. but there are a lot PUB-processes (the
count keeps changing) and only one SUB-sockets, so based on my
understanding the PUB-processes each would have to publish on separate
ports, and the SUB would have to do some kind of service-discovery to
find out on which ports it should listen. so i decided that this is
not the good way, and went with PUB/SUB. is there perhaps a way how to
achieve this with PUB/SUB?

thanks,
gabor



More information about the zeromq-dev mailing list