twilio-node icon indicating copy to clipboard operation
twilio-node copied to clipboard

retries for network errors (e.g. ECONNRESET)

Open mfulton26 opened this issue 1 year ago • 10 comments

sometimes Twilio calls fail for intermittent network/server errors (e.g. ECONNRESET); can the Auto-Retry with Exponential Backoff be updated or a similar option added to also retry under these conditions?

https://github.com/twilio/twilio-node/blob/55db7c2c5f2b56110333a03c4f4c6f02432489bd/src/base/RequestClient.ts#L37-L66

mfulton26 avatar Jun 06 '24 13:06 mfulton26

@tiwarishubham635 Can you please relate to this one? 🙏 We started to get multiple ECONNABORTED errors and this addition can help a lot.

adar-h-healthy avatar Oct 17 '24 14:10 adar-h-healthy

We have recently made these changes. I think this will help in your case. This will be available in the coming release

tiwarishubham635 avatar Nov 12 '24 06:11 tiwarishubham635

@tiwarishubham635 I might be missing something, but I can't see how this change can help here... It gives the option to change the timeout value, but it doesn't allow to override the retry configuration.

adar-h-healthy avatar Nov 17 '24 12:11 adar-h-healthy

@tiwarishubham635 Would it be ok if we'll open a PR with the change recommended in this issue?

adar-h-healthy avatar Nov 25 '24 11:11 adar-h-healthy

Sure, I'll be happy to review it

tiwarishubham635 avatar Nov 25 '24 11:11 tiwarishubham635

@tiwarishubham635 I'm having second thoughts about this and you might be able to assist. In some cases when we get the ECONNABORTED error (due to timeout), the request did manage to get to Twilio and the SMS is sent. If we will introduce this retry mechanism, it means that the same request MIGHT be sent twice to Twilio API. I assume that your side supports idempotency, but I wanted to validate this before starting.

adar-h-healthy avatar Nov 26 '24 07:11 adar-h-healthy

Yes, we do support Idempotency

tiwarishubham635 avatar Jul 14 '25 08:07 tiwarishubham635

@manisha1997 has a change been made to support retries for network errors (e.g. ECONNRESET)? last I checked twilio-node only retries 429 errors.

mfulton26 avatar Aug 01 '25 13:08 mfulton26

Apologies!

manisha1997 avatar Aug 04 '25 05:08 manisha1997

👋 Hi @mfulton26, thanks for reporting this issue!

Our Agent TwiDI has started analyzing and prioritizing this request.
Here’s what will happen next:

  • A PR will be created to address this issue.
  • The PR will be reviewed by our team members.
  • On approval, the PR will be merged into the main branch.
  • Once merged, the issue will be closed automatically and changes will be available in the next release.

⏳ Sit tight — we’ll keep you updated as we make progress.

twilio-dx avatar Sep 12 '25 12:09 twilio-dx