-
Notifications
You must be signed in to change notification settings - Fork 27
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
messages being processed multiple times by same worker name #99
Comments
Diving into how the visibility_timeout parameter works with SQS it seems like there is an answer, but that there might be a bug in propono. I believe this line:
should reference "@visibility_timeout" rather than 'visibility_timeout'. I'll investigate more during daylight. |
What have you set visibility_timeout to in your config? https://github.com/ihid/propono#visiblity-timeout |
That's just using the attr_reader not the instance variable directly. Shouldn't make a difference. |
Once I grokked the visibility timeout and resolved which client instance I needed to set it to, all is well. I put it on my todo list to write some documentation for the project about this. |
According to the readme, "subscribers that share the same application_name will act as multiple workers on the same queue. Only one will get to process each message", but this isn't true.
I have an app where processing each message is taking ~30 seconds of processor time.
Because of the code here:
propono/lib/propono/services/queue_listener.rb
Line 66 in 7b0dfe8
while the first worker is processing the message, a second worker has the opportunity to grab it.
Reversing those two lines kinds solves this issue, but creates a new one... a message can get lost if the worker fails during processing.
I don't think the semantics of sqs and sns alone can fix this issue one way or the other; sqs would need to be able to mark a message as 'processing'.
Perhaps deleting the message, calling the message handler, rescuing an exception, republishing the message, then re-raising the exception would be a potential strategy for handling this, but certainly raises the complexity.
The text was updated successfully, but these errors were encountered: