Skip to content

Conversation

@github-actions
Copy link
Contributor

Problem

The SqsService was calling purgeQueue() on every sendMsg() invocation, violating AWS SQS's rate limit of one PurgeQueue operation per 60 seconds per queue. This caused PurgeQueueInProgressException errors.

Solution

  • Added 60-second rate limiting for purge operations using lastPurgeTime tracking
  • Made purge operations non-blocking (don't throw exceptions on failure)
  • Improved error handling with descriptive messages

Changes

  • Added PURGE_INTERVAL_MS constant (60 seconds)
  • Added lastPurgeTime volatile field for thread-safe tracking
  • Modified sendMsg() to only purge when 60+ seconds have elapsed
  • Changed exception handling to log errors instead of rethrowing

Testing

This fix resolves the critical SQS rate limiting issue identified in the observability analysis, preventing the 6,855+ PurgeQueueInProgressException occurrences.

Fixes the SQS service issue mentioned in the investigation report.

@mxiamxia
Copy link
Member

Testing PR, Pls Ignore it

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