Closed markstos closed 8 years ago
Sounds reasonable. I don't use this module anymore so feel free to take this over.
On Tue, Jun 28, 2016, 8:53 AM Mark Stosberg notifications@github.com wrote:
@aheckmann https://github.com/aheckmann Any objection to re-trying requests when they fail to due to AWS throttling them?
There are some downsides:
- Memory growth due to email queued waiting for retry. This could be potentially be a lot. We either need to be OK with that, or have a maximum queue size to prevent exhausting memory.
- Potentially calling back much later when a response.
I could also argue that throttling code belongs in an external module, but it's also appealing to have this handled in the single module that all my mail sending gets routed through.
For comparison, I checked was the AWS JS SDK does. It doesn't support throttling, I presume because the module is trying to closely mirror the HTTP REST API, which doens't help with throttling / retries, either.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aheckmann/node-ses/issues/28, or mute the thread https://github.com/notifications/unsubscribe/AAKLssoqw-5GiL-yr4BkUFAgojMqS7wsks5qQUOMgaJpZM4JAQNI .
@aheckmann Thanks for the reply. Is there another SES mailer that you prefer now instead?
I'd probably use the official SDK but I haven't looked at it so can't say
On Thu, Jun 30, 2016, 10:13 AM Mark Stosberg notifications@github.com wrote:
@aheckmann https://github.com/aheckmann Thanks for the reply. Is there another SES mailer that you prefer now instead?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aheckmann/node-ses/issues/28#issuecomment-229725394, or mute the thread https://github.com/notifications/unsubscribe/AAKLsv_cVgwE9l4oDqMOQrVY4guwG9ASks5qQ_ksgaJpZM4JAQNI .
Note to self: We previously discussed automatic retries in #8 In that ticket the framing was about retrying on /any/ kind of failure. I think a response from AWS that "you are throttled" is a unique case. We know that the service is up and that we have permission to access it. The only problem is that we are accessing it too quickly. Retrying after some delay could automatically solve that problem. I don't think we need to handle complex cases like huge queue sizes or complex retry algorithms, but I think smoothing over infrequent cases of throttling would be a welcome default behavior.
I'll look some at how the details of this might be implemented and also perhaps look at what an external solution usinig retry might look like.
Another case worth retrying automatically a few times is 'ECONNRESET', which could simply indicate a hiccup with the connection with SES.
After more thought, automatic retry should not be a default feature. Here's why: there are two common cases for email sending and each is interested in different kinds of trade-offs:
Some sort of plugin/wrapper/extension could be used to provide this feature. The pull request I just submitted, #35, could help with this, as it allows consuming modules to access the function where we process the AWS response. That's the place where we would decide to retry a failed request if we choose to.
@aheckmann Any objection to re-trying requests when they fail to due to AWS throttling them?
There are some downsides:
I could also argue that throttling code belongs in an external module, but it's also appealing to have this handled in the single module that all my mail sending gets routed through.
For comparison, I checked was the AWS JS SDK does. It doesn't support throttling, I presume because the module is trying to closely mirror the HTTP REST API, which doens't help with throttling / retries, either.