[zeromq-dev] Re : Re: Are bindings supposed to set linger on implicit close/destroy?

Leonard Michelet leonard.michelet at openwide.fr
Thu Mar 19 09:20:41 CET 2015


I'm using https://github.com/zeromq/cppzmq since a couple of weeks and linger option is left at its default value by the binding.

----- Pieter Hintjens <ph at imatix.com> a écrit :
> The sentiment comes from trying and failing to fix the libzmq API on
> several occasions. You'll recall the last time I tried. It's not even
> clear that the linger setting *works* in libzmq, as people have
> reported it simply blocks for N seconds without sending anything.
> However, switching it off has worked very well in CZMQ, for years.
> 
> On Thu, Mar 19, 2015 at 2:27 AM, MinRK <benjaminrk at gmail.com> wrote:
> > (pyzmq maintainer here)
> >
> > I disagree with the sentiment expressed in the Guide. Either it belongs as
> > the libzmq default behavior itself, or it doesn't. It doesn't make sense to
> > me for language bindings to unanimously disagree with libzmq instead of
> > changing the underlying libzmq behavior.
> >
> > -MinRK
> >
> > On Wed, Mar 18, 2015 at 9:17 PM, Dylan Cali <calid1984 at gmail.com> wrote:
> >>
> >> Hello,
> >>
> >> The zguide states at the end of "Making a Clean Exit":
> >>
> >>> you need to shut down each socket that has ongoing requests. The proper
> >>> way is to set a low LINGER value (1 second), and then close the socket. If
> >>> your language binding doesn't do this for you automatically when you destroy
> >>> a context, I'd suggest sending a patch.
> >>>
> >>> ...
> >>>
> >>> Voila! It's complex and painful enough that any language binding author
> >>> worth his or her salt will do this automatically and make the socket closing
> >>> dance unnecessary.
> >>
> >>
> >> Yet I noticed the pyzmq bindings do not seem to follow this convention and
> >> scripts that do not explicitly set linger themselves hang.  The pyzmq devs
> >> closed this as a non-issue:
> >>
> >> https://github.com/zeromq/pyzmq/issues/102
> >>
> >> Conversely, both the czmq and jzmq bindings do set a low linger:
> >>
> >> https://github.com/zeromq/czmq/issues/116
> >> http://git.io/hBaf
> >>
> >> So should this be considered a bug in pyzmq, and as a bindings author
> >> should I follow the convention of setting a low linger?
> >>
> >> Thanks much,
> >> Dylan
> >>
> >>
> >>
> >> _______________________________________________
> >> zeromq-dev mailing list
> >> zeromq-dev at lists.zeromq.org
> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >>
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> 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