aio-pika
aio-pika copied to clipboard
Incorrect processing of message
I think there is inconsistency of IncomingMessage.__processed
flag with the state at the server side.
Here is the processing within IncomingMessage.ack
method:
https://github.com/mosquito/aio-pika/blob/d65c2f4551b4fd75e4e15443042d716b3ac68c3c/aio_pika/message.py#L544-L552
If there was an error in basic_ack
task then message will be marked as processed whatever.
I guess there should be awaiting of task before marking message as processed.
So ack
, reject
and nack
methods of IncomingMessage
should become async.
Another but not the best way (to save backward compatibility) is to mark message as processed at done
callback of the task.