[rabbitmq-discuss] precondition_failed error with amqp_client for erlang

Max Warnock maxjwarnock at gmail.com
Wed Jun 29 23:28:59 BST 2011

I've built a behavior in erlang to subscribe to a given topic exchange and
farm out message handling.  I'm using the rabbitmq amqp_client library for
erlang and when I put the system under heavy load I get, on occasion, the
following error:

=ERROR REPORT==== 29-Jun-2011::18:02:18 ===
** Generic server <0.1117.0> terminating
** Last message in was {'$gen_cast',
                                   <<"PRECONDITION_FAILED - unknown delivery
tag 856">>,
** When Server state == {state,1,<0.1116.0>,network,





** Reason for termination ==
** {server_initiated_close,406,
                           <<"PRECONDITION_FAILED - unknown delivery tag

The server receive loop where the ack happens looks like this:
{#'basic.deliver'{delivery_tag = Tag, routing_key = RoutingKey},
#amqp_msg{payload = Payload}} ->
    amqp_channel:cast(get(amqp_channel_pid), #'basic.ack'{delivery_tag =
    spawn_and_queue(spawn_handle_message, Module, RoutingKey, Payload),

The amqp_client_sup can't seem to bring back the the client either and dies
from the retry intensity being reached.  I've done a hefty amount of
googling and can't seem to find where things could be going wrong.  Before
jumping into the amqp_client code I thought I'd ask the mailing list if they
have any ideas.  The only thing I can think is that there is a race
condition within the client library.  I will be double checking my code to
be sure it isn't sending the ack twice, but given the simplicity of the ack
the only way it could is if it receives the same message (with identical
delivery tag) from the amqp_client library twice.

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

More information about the rabbitmq-discuss mailing list