[zeromq-dev] [PATCH] Publisher side filtering

Martin Sustrik sustrik at 250bpm.com
Wed Jan 19 15:31:45 CET 2011


> Following patch identifies the issue, but I have doubts about the
> strategy to follow with regards to the pipes_attached
> boolean and the other pipe that seems to keep hanging around. Wouldn't
> the code in this way create a memory leak?
> Also, it's probably not a good idea to get rid of the "zmq_assert".  I
> was thinking that a better way to solve this may be
> the introduction of two boolean variables.. one for "in" direction and
> other for "out" pipe attached direction.

Yes, the code is a bit creaky. I'll have a look. In the long run it can 
possibly make sense to provide a single bi-directional pipe between 
socket and session instead on two separate uni-directional pipes...

> This is patched against "sub-forward" branch.
> With this fix, the subscriptions are always forwarded upstream,
> regardless of which process is terminated.
> This strategy allows subscribers to resubmit their subscriptions on a
> reconnection, but now that the session has no knowledge
> of subscriptions, there are no unsubscribes sent upstream on behalf of a
> subscriber when the subscriber goes away. In effect,
> the only way to get rid of a subscription is by an explicit unsubscribe.

I think the publisher should drop all the subscriptions when 
disconnection happens. That way it will receive fresh set of 
subscriptions upon reconnection with no need for explicit unsubscriptions.

> ( i.e... for longer uptimes and temporary topics, it is possible that a
> broker starts to receive and send more data than needed )
> Not sure if that is deemed important to 0MQ to resolve.


More information about the zeromq-dev mailing list