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

SQS QueuePoller sometimes returns dupe messages, raises BatchEntryIdsNotDistinct #2913

Closed
alextwoods opened this issue Sep 22, 2023 Discussed in #2908 · 1 comment
Closed
Labels
feature-request A feature should be added or improved.

Comments

@alextwoods
Copy link
Contributor

Discussed in #2908

Originally posted by jdelStrother September 6, 2023
We use Aws::SQS::QueuePoller like so:

poller = Aws::SQS::QueuePoller.new(queue_url, idle_timeout: 0, wait_time_seconds: 1)
poller.poll(max_number_of_messages: 10) do |batch|
  do_work(batch)
end

Very rarely - say, every 100k requests - batch contains duplicate messages, with the same message_id & body, but different receipt_handles.

When QueuePoller tries to clean up these messages (after do_work is complete), it calls delete_message_batch which raises Aws::SQS::Errors::BatchEntryIdsNotDistinct.

I've not discovered this behaviour documented anywhere (that SQS might occasionally return duplicate messages when calling ReceiveMessage). It's presumably not considered a bug in SQS itself (..?) so should the SDK fix it by de-duping in Client#receive_message or QueuePoller#receive_messages ? Or is this considered an end-user problem to deal with?

@alextwoods alextwoods added the investigating Issue is being investigated label Sep 22, 2023
@mullermp mullermp added feature-request A feature should be added or improved. and removed investigating Issue is being investigated labels Sep 29, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants