[zeromq-dev] Compatibility 3.1 - 3.2.1-rc2

Andrew Hume andrew at research.att.com
Fri Nov 16 13:25:13 CET 2012


this issue of asserts is starting to cause me grief with my colleagues.
for example, zmq_connecter.cpp:47 reads like

	int rc = tcp_connector.set_address(protocol_, address_);
	assert(rc == 0)

until yesterday, i had never seen a problem with this.
but yesterday, we had one site have an internet connection failure.
which caused something weird to happen, which caused
the libc function getaddrinfo to fail. when that happens, the above assert trips.
this is hardly incoherent behaviour, but  there it is.

we are trying to figure out how to handle this.
unfortunately the guy taking over me on this project is a real
NIH person, and wants to just chuck zmq. sigh....

On Nov 16, 2012, at 5:12 AM, Martin Hurton wrote:

>> Asserts are made to check for clear incoherent behavior in a library.
>> Something that just could not happen if the library is coded properly. They
>> should check for things like function pre/post conditions. They are for
>> library developers, not end users!
>> A change in the wire format causing an assert is just not the proper way to
>> handle the problem, since this is completely unrecoverable on the library
>> user side.
>> 
>> This may be generalized to the fact that asserts should not be used for
>> anything exterior to the library (such as the wire protocol). For instance,
>> in a file management library, you don't want an assert to be triggered if
>> there is no space left on the device: you want an error code! I cannot
>> afford my whole program to crash, just because the broker on the other side
>> was updated.
> 
> Which assertion fails in this case? In which version of lib?
> 
> - Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev


-----------------------
Andrew Hume
623-551-2845 (VO and best)
973-236-2014 (NJ)
andrew at research.att.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121116/a2689ad2/attachment.htm>


More information about the zeromq-dev mailing list