[rabbitmq-discuss] Queries regarding rabbitmq-C APIs

Alan Antonuk alan.antonuk at gmail.com
Tue Oct 29 16:34:45 GMT 2013


Shashank;

On Mon, Oct 28, 2013 at 3:15 AM, Lothe Shashank <
Shashank.Lothe at techmahindra.com> wrote:
>
>
> 1. Is there is a way to check from rabbitmq-c library function, if the
> network cable is pulled out?
>
As far as I know, there isn't a portable socket API for detecting a network
cable from being pulled. The best we can do is to detect when the TCP
connection has been closed. All rabbitmq-c functions that cause a read or
write to the socket check the return from these functions to detect the
socket being closed unexpectedly.  If the socket is closed the client will
receive an AMQP_STATUS_SOCKET_CLOSED or AMQP_STATUS_SOCKET_ERROR as a
return value.


> Why amqp_basic_publish API returns success if network cable is pulled out
> from client?
>
What's happening most likely is that the OS has not detected that that the
socket has been closed, and since the message being published is smaller
than the socket's send buffer, the data is being buffered by the OS.

>
>

> 2. Establish connection with broker. Pull out network cable, call
> amqp_channel_close. It crashes.
>
3. Establish connection with broker for auto delete queue and do
> "rabbitmqctl stop_app" on broker. The connection is closed automatically.
> Now call amqp_destroy_connection.  It crashes.
>
I've heard reports of this happening, but I haven't got any more detail on
what is happening besides "it crashes". What is causing the crash?
Segfault? Some other uncaught signal? (SIGPIPE for example)? Something
else? If you have some other information about the crash or how I could
reproduce it that would be helpful.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131029/ab04e39d/attachment.htm>


More information about the rabbitmq-discuss mailing list