MetPX / sarrac

C implementation of (a subset of) Sarracenia (large scale file transfer utility)
GNU General Public License v2.0
4 stars 1 forks source link

support explicit acks #121

Open petersilva opened 10 months ago

petersilva commented 10 months ago

in working on #120, I noticed that the C consumer auto_acknowledges messages in the library, in contrast to the careful control of acks in the python3.


             amqp_basic_consume(sr_c->cfg->broker->conn, 1,
                                   amqp_cstring_bytes(sr_c->cfg->queuename),
                                   //amqp_empty_bytes, // consumer_tag
                                   amqp_cstring_bytes(consumer_tag), 0, // no_local
                                   1,   // no_ack ( == auto-ack ) - if set to 1, then comment out basic_ack code above.
                                   0,   // not_exclusive
                                   amqp_empty_table);

The no_ack refers to not requiring the client to acknowledge messages. Long ago, I think there was testing of using acknowledgement, and the code is still there in comments... so I guess it never worked. Should revisit at some point.

petersilva commented 9 months ago

I think this defect means all the flakey_broker flow tests can fail randomly because the C consumer will lose messages when the broker goes away (closing down the connection discards messages received by the library but not yet passed to client ... this seems to happen in some flakey_broker tests.) ))

petersilva commented 9 months ago

sample output from tests:


test 6 FAILURE: compare contents of downloaded_by_sub_amqp and cfile differ

disabling this test in flow tests until this issue is resolved. the c consumer is not going to be resilient to failures until this is addressed.