[zeromq-dev] [PATCH] Improved response to socket violations
mato at kotelna.sk
Fri May 20 18:25:49 CEST 2011
ph at imatix.com said:
> On Fri, May 20, 2011 at 5:50 PM, Martin Lucina <mato at kotelna.sk> wrote:
> > 1) The message itself is misleading. There are many people who run into
> > issues with mailbox due to a completely *different* problem, namely system
> > resource limits (e.g. OSX). This has nothing to do with socket migration.
> Do they hit this actual assert?
That's one of them they can hit, yes. Read the code :-)
> > 3) Last but not least, IMHO libraries should *not* print "helpful"
> > messages. This leads to horrible practices, for example start a random Gtk
> > application; you will more often than not see all sorts of assertion
> > failures and other crap printed and it's obvious that no one cares, much
> > less does anything about it.
> Libraries should not print unhelpful messages either. I don't see how
> telling the user where to look will lead to horrible practice.
> E.g. we already print a "helpful" messages on OOM, and it does actually work.
Which is probably the right thing to do for internal allocations where we
can't recover; see my other email. But for anything which can actually
return ENOMEM to the user that's what we should do.
> > I realise you have an assert(0) there so the code *will* fail, but I'd
> > still like to avoid going down this path.
> Can you propose an alternate path that solves the problem in hand,
> instead of just rejecting this one?
> The problem here is wasted time re-solving a *known* issue.
Put up a FAQ about thread safety then, and explicitly tell people not to
migrate sockets between threads.
More information about the zeromq-dev