-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Memoization of boolean causes extra calls to SQS #529
Conversation
Co-authored-by: Alec Kloss <[email protected]> Co-authored-by: William Johnston <[email protected]>
d0d16bd
to
e73963f
Compare
Co-Authored-By: timbreitkreutz <[email protected]>
@phstc Thanks for the feedback. I think this is ready to go :) |
@timbreitkreutz thanks for the fix 🍻 Shoryuken 3.3.1 is out with your fix. |
I think I found another unexpected behavior with FIFO queues and Shoryuken:
In the way Shoryuken works now, it is grabbing up to 10 messages per What I think it should do instead is every time it fetches messages for a FIFO queue, it should fetch one at the time: def receive_messages(queue, limit)
options = receive_options(queue)
shoryuken_queue = Shoryuken::Client.queues(queue.name)
options[:max_number_of_messages] = shoryuken_queue.fifo? ? 1 : max_number_of_messages(limit, options)
options[:message_attribute_names] = %w[All]
options[:attribute_names] = %w[All]
options.merge!(queue.options)
shoryuken_queue.receive_messages(options)
end Otherwise, you may end up processing more than one message per group at the time. WDYT? |
Makes sense to me— we are not yet using fifo queues with shoryuken though. |
This was causing us to get rate limited by SQS. Our team eventually found this boolean memoization bug which solved the rate limiting problem for us.