<div>Hello,<br></div><div><br></div><div>Working with rabbitmq, I found a nasty behavior relating to queue and their TTL. If you send a persistant message to a durable queue when the queue have a TTL over 4.294.967.295 (max 32bit int, or FF FF FF FF), then the queue is destroyed if the message is not consumed immediately.</div>
<div><br></div><div>Here the simplest test I have made :</div><div>a user "test_user" (with a password "test_user") ;</div><div>a vhost "p" ;</div><div>a queue named "test", durable, with a TTL > 4.294.967.295 (no autodelete) ;</div>
<div>no arguments ;</div><div><br></div><div>the direct exchange "amq.direct" bind to the queue with no routing key and no arguments ;</div><div><br></div><div>send a persistant message (delivery mode = 2, no routing key, no header nor properties, only a basic payload "bla").</div>
<div><br></div><div>Then the queue is destroyed.</div><div><br></div><div>Rabbitmq version 2.7.1</div><div>test made with management interface and php client.</div><div><br></div><div>I think this is related to the storage of the message (due to the behavior I observed while testing with shovels).</div>
<div><br></div><div>I may not need a so large TTL, but I think you should know about this.</div><div><br></div><div>Here is the error log :</div><div><br></div><div>=ERROR REPORT==== 13-Apr-2012::16:09:13 ===<br>** Generic server <0.31584.0> terminating<br>
** Last message in was {deliver,<br> {delivery,true,false,<0.9065.1>,<br> {basic_message,<br> {resource,<<"p">>,exchange,<<"amq.direct">>},<br>
[<<>>],<br> {content,60,<br> {'P_basic',undefined,undefined,[],2,undefined,<br> undefined,undefined,undefined,undefined,undefined,<br>
undefined,undefined,undefined,undefined},<br> none,none,<br> [<<"bla">>]},<br> <<"Y<C9><FF>e<B1><B6>d<A1> ZU<D6><E9><E0><E2><BE>">>,true},<br>
1}}<br>** When Server state == {q,<br> {amqqueue,<br> {resource,<<"p">>,queue,<<"test">>},<br> true,false,none,<br>
[{<<"x-message-ttl">>,long,4294967296}],<br> <0.31584.0>,[],undefined},<br> none,false,rabbit_variable_queue,<br> {vqstate,<br>
{0,{[],[]}},<br> {0,{[],[]}},<br> {delta,undefined,0,undefined},<br> {0,{[],[]}},<br> {0,{[],[]}},<br>
0,<br> {0,nil},<br> undefined,<br> {0,nil},<br> {qistate,<br> "/var/lib/rabbitmq/mnesia/rabbit@rabbithost/queues/BKL005Z7FOY4NF6WMR7ER<br>
BLZV",<br> {{dict,0,16,16,8,80,48,<br> {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},<br> {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],<br>
[]}}},<br> []},<br></div><div> undefined,0,262144,<br> #Fun<rabbit_variable_queue.2.91259159>,<br> {0,nil}},<br>
{{client_msstate,msg_store_persistent,<br> <<72,21,86,28,220,67,150,223,124,123,50,154,225,<br> 109,132,157>>,<br> {dict,0,16,16,8,80,48,<br>
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},<br> {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],<br> []}}},<br> {state,1134659,<br>
"/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_persistent"},<br> rabbit_msg_store_ets_index,<br> "/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_persistent",<br>
<0.11231.0>,1138754,1130564,1142841,1146950},<br> {client_msstate,msg_store_transient,<br> <<154,31,168,204,117,254,217,155,174,95,243,199,81,<br>
128,111,88>>,<br> {dict,0,16,16,8,80,48,<br> {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},<br> {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],<br>
[]}}},<br> {state,1114170,<br> "/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_transient"},<br> rabbit_msg_store_ets_index,<br>
"/var/lib/rabbitmq/mnesia/rabbit@rabbithost/msg_store_transient",<br> <0.11226.0>,1118269,1110080,1122364,1126465}},<br> true,0,#Fun<rabbit_amqqueue_process.5.18121064>,0,0,<br>
infinity,0,0,0,0,0,<br> {rates,<br> {{1334,325010,274464},0},<br> {{1334,325010,274464},0},<br> 0.0,0.0,<br>
{1334,325011,275021}},<br> {0,nil},<br> {0,nil},<br> {0,nil},<br> {0,nil},<br> 0,0,<br>
{rates,<br> {{1334,325010,274464},0},<br> {{1334,325010,274464},0},<br> 0.0,0.0,<br> {1334,325011,275021}}},<br>
{[],[]},<br> undefined,undefined,undefined,undefined,<br> {state,fine,5000,undefined},<br> {0,nil},<br> 4294967296,undefined}<br>
</div><div>** Reason for termination == <br>** {badarg,[{erlang,send_after,[4294967296,<0.31584.0>,drop_expired]},<br> {rabbit_amqqueue_process,ensure_ttl_timer,1},<br> {rabbit_amqqueue_process,handle_call,3},<br>
{gen_server2,handle_msg,2},<br> {proc_lib,wake_up,3}]}<br></div>