-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
SES: fix infinite loop with SNS event destination #12972
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
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 2m 44s ⏱️ - 1h 39m 57s Results for commit dbdc8b6. ± Comparison against base commit cd7b481. This pull request removes 4460 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 11m 35s ⏱️ Results for commit dbdc8b6. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one request. Other affected tests also need updating but it's out of scope.
tests/aws/services/ses/test_ses.py
Outdated
sender_email_address, recipient_email_address = setup_email_addresses() | ||
config_set_name = f"config-set-{short_uid()}" | ||
|
||
EMAILS.clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ask to use the REST endpoint for SES email introspection because tests are not guaranteed to run in the same process as LocalStack.
- GET
/_aws/ses
- DELETE
/_aws/ses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, makes sense 👍 will update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinging @giograno: Are there test fixtures for the LocalStack SDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that actually would be super great to use 👍 I think we can do a second pass to update all usage of EMAILS
and use the SDK instead 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@viren-nadkarni, we don't have it atm, but we should totally do it. Happy to take this :D
145adce
to
dbdc8b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good 💯
Motivation
While testing an SES/SNS sample, we encountered an issue where sending an email with SES with an SNS event destination configured that would have another SES subscriber, it would trigger an infinite loop.
There were 2 problems:
send
anddelivery
notification even if you didn't configure itConfigurationSet
, even if you did not specify aConfigurationSetName
. SES only sends event notification if you pass aConfigurationSetName
becauseEventDestinations
are inherently linked to a configuration set, see https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-using-event-publishing-setup.htmlThere is still one somewhat big issue because Moto only accepts one
EventDestination
per configuration set, even if AWS accepts multiple, Moto will overwrite it every time you callCreateConfigurationSetEventDestination
, but this is out of scope.Changes
SNSEmitter
and add new kind of destinations