When the message receipt is in progress and worker starts to shutdown, the worker will wait for the message to be received from the broker but will not process it and the task will end up not to be executed until visibility timeout.
Worker should wait until the receiving message is finished processing, and then shutdown gracefully.
Hi, I'm using v1 and sqs as a broker.
When the message receipt is in progress and worker starts to shutdown, the worker will wait for the message to be received from the broker but will not process it and the task will end up not to be executed until visibility timeout.
Worker should wait until the receiving message is finished processing, and then shutdown gracefully.
The main reason why this is happening is that the worker stops to consume new task by closing
b.stopChan
before all the message is finished receiving. https://github.com/RichardKnop/machinery/blob/master/v1/common/broker.go#L117Closing
deliveries
before the task process is finished will also make the receiving message not able to be processed. https://github.com/RichardKnop/machinery/blob/master/v1/brokers/sqs/sqs.go#L86