-
Notifications
You must be signed in to change notification settings - Fork 249
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
SES V1/2 Reliability Issues #844
Comments
Hey @AnBowell, thanks for submitting this bug. Can you enable |
No worries, thanks for the super quick response! So at the top level, I get "dispatch failure". With the debug/trace logging enabled using tracing_subscriber I also see this:
I've now also matched on the error and printed that too.
|
I think the core thing to establish is this:
You can set timeouts and retry behavior on the sdk config if you use I'd like to look further into this myself but my week is rather busy. Hopefully the above tips will help reveal the real issue, but if they don't, I'll test this myself as soon as I'm able. |
Ah—I've seen this GoAway error before. I had a really hard time reproducing it. Do you see the retries happening? Does it fail even after retries? Do you see logs re-establishing the connection in Hyper? |
Thanks again for the quick responses. I tried a new test of sending four emails, about a minute apart using the settings @Velfi recommended. I decreased the operation timeout to 200 milliseconds and increased the number of retries to 10. I also tried the with and without the "ReuseAllConnections" Reconnect mode. With these settings I possibly got some interesting logs. On the second email, I could see Hyper waiting for the connection: then attempting to connect: and then pooling: and then dropping the connection: which then resulted in a timeout error: However, on the third email I first got an attempt to take the connection: a connection was then closed: and then checked out: and then a connection request: pooling: dropped: but then a successfully parsed response: I can't seem to see in the logs where requests are being retried at all. As for the GoAway error, it seems really transient and I can't reproduce it with every run of the test either. I've managed to get a better success rate by upping the operation timeout to 10 seconds (from 1s) and giving it 10 maximum retry attempts. Is it possible it's just not connecting within the default timeout duration? When emails are to be sent from the Lambda, I see they run for much longer than I'd expect. For now I hope this "solution" holds up, sorry I can't be more helpful, this is my first time using the SES crate. |
Thanks for the details logs. We're going to try to reproduce this on our side and see what we can do. The issue you linked seems probably a red herring—I think they're using the SMTP API instead of the HTTP API for SES. It seems like there is a likely bug in the connection management somewhere. |
Were you able to figure out the culprit here? I'm getting consistent "dispatch failure" errors too when I'm trying to start instances. It's happening from one ec2 instance but when I try it from my laptop it's working fine. |
The GOAWAY error is being addressed in #738 and will be fixed in an upcoming release. |
The fix for GOAWAY retries has been released. |
Has anyone run into this on the latest code? I'm going to close this for now, but feel free to reopen if you hit this issue! |
|
Describe the bug
I have a lambda function which I would like to use to send an email via SES.
Following the example in this repo, I achieved this functionality; though, around 50% of the time the emails fail to go through and are reported as a "dispatch failure" or upon further investigation, an HTTP response timeout.
My AWS account has been approved with a sending limit of 50k emails per day / 14 per second, and it can sometimes fail on the first email of the day, so I don't believe it to be a throttling problem. No bounces or failures are reported in the SES console.
I have found a very similar issue reported here: knadh/listmonk#81
Expected Behavior
Emails sends are successful 100% of the time.
Current Behavior
Emails are only successfully sent about 50% of the time.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
Version
Environment details (OS name and version, etc.)
Windows 10 - cargo-lambda 0.19.3 (2023-06-07Z)
Logs
Internal message | Cannot send email for some reason: dispatch failure
The text was updated successfully, but these errors were encountered: