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

Add validation to check that notifications dont exceed sqs msg limit #2085

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

whabanks
Copy link
Contributor

@whabanks whabanks commented Jan 18, 2024

Summary | Résumé

Notifications payloads sent to /v2/notifications/{type} are now checked to ensure that their size in bytes does not exceed the SQS message payload size limit.

  • Add logging that identifies the largest piece of data when oversized payloads are attempted.
  • Add a message informing the API user of the size limit and pointing them to the largest item in their payload as a guide.
  • Add a recursive utility method to flatten a dict for easier processing in some situations.

SQS has a payload limit 262,144 bytes, or 256Kib. When Celery attempts to consume inflights that are greater than this size limit it will fail and the message is returned to the inflight inbox. This loop continues until the inflight is expired thus creating a lot of unnecessary Celery errors in our logs.

@whabanks whabanks changed the title Add validation to check that a notification does not exceed sqs messa… Add validation to check that notifications dont exceed sqs msg limit Jan 22, 2024
@whabanks whabanks marked this pull request as ready for review January 22, 2024 14:33
@whabanks whabanks marked this pull request as draft January 22, 2024 14:33
@whabanks whabanks marked this pull request as ready for review January 22, 2024 17:21
@jzbahrai
Copy link
Collaborator

@jzbahrai jzbahrai marked this pull request as draft January 24, 2024 20:01
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.

2 participants