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

fix: allow message processing of duplicate message after 60 seconds #2074

Conversation

kalaspuff
Copy link
Owner

Fixes a bug for AWS SQS queues with dead-letter queue configured which would trigger if SQS.DeleteMessage calls would unexpectedly fail or fail all retries for a message and the same message would be received again to the same consumer over and over again, where it would be ignored as a duplicated SQS message, until it would be sent to the DLQ. Even if the message was redrived to the queue and the same consumer would keep receiving it, it would still ignore the message as a duplicate. This would cause the message to be stuck in a loop.

Note that this change will run the handler function of the consumer after 60 seconds has passed and it receives the message again, which in a setup where a service has a single receiving consumer leaves responsibility of the handler to handle idempotency more strictly, in the same way as in setups with multiple consumers.

@kalaspuff kalaspuff changed the title Feature/allow message processing of duplicate message after 60 seconds fix: llow message processing of duplicate message after 60 seconds Feb 14, 2025
@kalaspuff kalaspuff changed the title fix: llow message processing of duplicate message after 60 seconds fix: allow message processing of duplicate message after 60 seconds Feb 14, 2025
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 17.64706% with 14 lines in your changes missing coverage. Please review.

Project coverage is 73.98%. Comparing base (c8a2f54) to head (e989d96).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
tomodachi/transport/aws_sns_sqs.py 17.64% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2074      +/-   ##
==========================================
- Coverage   74.04%   73.98%   -0.06%     
==========================================
  Files          53       53              
  Lines        8086     8095       +9     
==========================================
+ Hits         5987     5989       +2     
- Misses       2099     2106       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kalaspuff kalaspuff merged commit ebd1ae8 into master Feb 14, 2025
13 of 14 checks passed
@kalaspuff kalaspuff deleted the feature/allow-message-processing-of-duplicate-message-after-60-seconds branch February 14, 2025 12:42
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

Successfully merging this pull request may close these issues.

1 participant