Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving message will not be processed until visibility timeout when worker starts to quit #785

Open
tomo25 opened this issue Nov 7, 2022 · 1 comment

Comments

@tomo25
Copy link

tomo25 commented Nov 7, 2022

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#L117

Closing 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

@tomo25 tomo25 changed the title Receiving Task will not be processed while worker is quitting Receiving message will not be processed until visibility timeout when worker starts to quit Nov 7, 2022
@tomo25
Copy link
Author

tomo25 commented Nov 20, 2022

here is an implementation for sqs.
tomo25#1

it's working for me so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant