[zeromq-dev] Publisher side filtering... (draft II )

Gerard Toonstra gtoonstra at gmail.com
Thu Jan 13 13:41:32 CET 2011

Hi Martin,

See patch attached. The session is yet untouched. The pipes were made
bi-directional. The use of the xsub now got me into a couple
of core dumps, because pipe management was not done. So I put in pipe
management in the xsub to get rid of those dumps. It happened
when a publisher exited and reconnected, leaving invalid pipes around.

( #0  0x00353416 in __kernel_vsyscall ()
#1  0x00ab9941 in raise (sig=6) at
#2  0x00abce42 in abort () at abort.c:92
#3  0x00a3caba in zmq::writer_t::process_pipe_term (this=0x87cef20) at
#4  0x00a36fbd in zmq::object_t::process_command (this=0x87cef20, cmd_=...)
at object.cpp:98
#5  0x00a46421 in zmq::socket_base_t::process_commands (this=0x87c0018,
block_=false, throttle_=false) at socket_base.cpp:686
#6  0x00a46b23 in zmq::socket_base_t::getsockopt (this=0x87c0018, option_=0,
optval_=0xbfaad25c, optvallen_=0xbfaad260) at socket_base.cpp:269
#7  0x00a52f00 in zmq_getsockopt (s_=0x87c0018, option_=15,
optval_=0xbfaad25c, optvallen_=0xbfaad260) at zmq.cpp:303
#8  0x00a53358 in zmq_poll (items_=0xbfaad2d0, nitems_=2, timeout_=-1) at
zmq.cpp:431 )

With the pipe management in xsub, that crash was resolved.

With this patch, nothing yet changes from user's perspective:

- The regular PUB/SUB should continue to function as they are (xsetsockopt
sub change, no upstreaming yet)
- The XSUB and XPUB don't yet have any of the required functionality, just
good base classes for PUB/SUB and bidi pipe management
- You can't yet set any subscription on an XSUB (that's done through xsend
rather than xsetsockopt)
- Sessions are entirely unmodified



On Thu, Jan 13, 2011 at 10:27 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:

> Hi Gerard,
>  This is the most current patch for the publisher side filtering.
> Great! Can we start to slowly pull it into the trunk? Given the size of the
> change I would break it into several smaller patches.
> The first step, IMO, would be to provide bi-directional communication
> between socket object and session object (i.e. creating a pipe in the
> opposite direction). Can you extract that part from your patch and provide
> it as a stand-alone patch?
> Once it's applied and tested we can proceed with subsequent steps.
> Martin

Gerard Toonstra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110113/05ad7d0c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pipes.patch
Type: text/x-patch
Size: 4660 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110113/05ad7d0c/attachment.bin>

More information about the zeromq-dev mailing list