Skip to content

fix SNS storing lambda invocation logs + improve parity#7771

Merged
thrau merged 2 commits intomasterfrom
fix/7768
Mar 1, 2023
Merged

fix SNS storing lambda invocation logs + improve parity#7771
thrau merged 2 commits intomasterfrom
fix/7768

Conversation

@bentsku
Copy link
Contributor

@bentsku bentsku commented Mar 1, 2023

This PR fixes #7768, a regression introduced by remove a call to json_safe on the payload.
However, there was no payload to get here, because the lambda invocation is asynchronous. The parity was wrong here, and it's nice to be able to introduce additional behaviour in SNS.
I've introduced a test by retrieving CloudWatch logs for this particular scenario and improved parity.

We would still need to check parity for all other "Publisher" (SQS, Kinesis, HTTP and Platform application endpoint), to see how they store their logs. See https://docs.aws.amazon.com/sns/latest/dg/sns-topic-attributes.html

We will also need to add a conditional on storing the logs, as they should be enabled first.

Note: I'll introduce a scenario fixture regarding setting up the logs for Success/Failure in SNS when introducing the next parity check for another publisher!

@bentsku bentsku requested a review from thrau March 1, 2023 13:28
@bentsku bentsku temporarily deployed to localstack-ext-tests March 1, 2023 13:28 — with GitHub Actions Inactive
@bentsku bentsku self-assigned this Mar 1, 2023
@bentsku bentsku added the aws:sns Amazon Simple Notification Service label Mar 1, 2023
@coveralls
Copy link

Coverage Status

Coverage: 85.101% (-0.009%) from 85.11% when pulling cd3bf3b on fix/7768 into ee27d16 on master.

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

LocalStack integration with Pro

       3 files  ±0         3 suites  ±0   1h 46m 52s ⏱️ + 15m 53s
1 774 tests +1  1 394 ✔️ ±0  380 💤 +1  0 ±0 
2 500 runs  +1  1 770 ✔️ ±0  730 💤 +1  0 ±0 

Results for commit cd3bf3b. ± Comparison against base commit ee27d16.

♻️ This comment has been updated with latest results.

@bentsku bentsku temporarily deployed to localstack-ext-tests March 1, 2023 15:20 — with GitHub Actions Inactive
Copy link
Member

@thrau thrau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! nice find, sns parity with publishers is tricky :-)

@thrau thrau merged commit 71b5cfd into master Mar 1, 2023
@thrau thrau deleted the fix/7768 branch March 1, 2023 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws:sns Amazon Simple Notification Service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: SNS Topic Publish to Lambda throws an Exception

3 participants