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

connect ETIMEDOUT 54.90.52.143:443 #1354

Open
baileywall opened this issue Mar 24, 2022 · 3 comments
Open

connect ETIMEDOUT 54.90.52.143:443 #1354

baileywall opened this issue Mar 24, 2022 · 3 comments
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@baileywall
Copy link

Issue Summary

In our production environment we send thousands of emails per day via sendMultiple. Over the past week or so we have run into this error intermittently: connect ETIMEDOUT 54.90.52.143:443

I've reached out to sendgrid support and was initially told that this is a rate limit issue, but our volume per second doesn't even come close to what we've been told the max rate is (10k a second) and we aren't seeing the 429 errors that the documentation says are returned in the case of exceeding the limit. I was then told it's probably just a connection issue, and to wait a few seconds and re-issue the request. Sporadic connection issues are worrying enough that I think some investigation is warranted, even though at our volume simply re-issuing the request will likely mitigate the issue for us (for now).

Steps to Reproduce

  1. Send many emails via the sendMultiple method and wait for one of them to timeout due to a connection issue

Code Snippet

import { MailData } from '@sendgrid/helpers/classes/mail';
import mail from '@sendgrid/mail';
    
mail.setApiKey(apiKey);

const emailDataObject: MailData = {...};

return await mail.sendMultiple(emailDataObject);

Exception/Log

Error: connect ETIMEDOUT 54.90.52.143:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
    at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:126:14)
 => awaited here:
    at Function.Promise.await (/app/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
    at server/external-apis/emailClient.ts:142:5
    at /app/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
 => awaited here:
    at Function.Promise.await (/app/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
    at server/modules/email/email-notifications/emailDigest.ts:884:3
    at /app/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40

Technical details:

  • sendgrid-nodejs version: 6.4.0
  • node version: 14.17.5
@baileywall
Copy link
Author

noticed this issue that seems like the same issue from February 2019 (that is now closed, which is why I've opened a new issue): #896

@childish-sambino
Copy link
Contributor

I think setting a default request timeout and utilizing the keepAlive parameter in the axios client should prevent this.

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@childish-sambino childish-sambino added type: community enhancement feature request not on Twilio's roadmap status: help wanted requesting help from the community labels Mar 30, 2022
@yiyao8932
Copy link

I'm also experiencing the same issue but I see a different IP address 54.248.129.79:443 in the error message. It just started a few weeks ago. Our production environment sends at most 1000 emails per hour.

Here's our sample code

import { MailDataRequired } from "@sendgrid/helpers/classes/mail";
import sendgrid from "@sendgrid/mail";

sendgrid.setApiKey(SENDGRID_API_KEY);
sendgrid.setTimeout(30000);

const sendGridMailArguments: MailDataRequired = {...};
await sendgrid.send(sendGridMailArguments); 

We use for loop to send out emails one by one but we have also added a wait for 500ms between each email.
I also notice that each timeout waits for 2 minutes before it proceeds to next email sending.

Technical details:

  • sendgrid/mail version: 7.1.1

  • node version: 10.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

3 participants