We need requests to be quick because e.g. for phone number lookup we have to complete the request within 30 seconds due to Heroku router constraints
We set the http client time out to 10 seconds which seems reasonable
When we get an execution expired due to http client timeout on message send, it's possible that Twilio eventually processed the request.
We don't want to send the message twice.
It would be best if Twilio closed the connection with an error code https://www.twilio.com/docs/api/errors/20500 rather than for the http client to timeout and then we'd have to wait some amount of time to try to see if the message exists in in the logs
Right now we need to wait maybe 26 seconds for Twilio to timeout which means we can only use the 10 second timeout if we're sure we're not making transactional requests, as per the docs: "POST requests - sending an SMS or triggering an outbound call - are not idempotent. If you get a 500 Server Error on these requests, and you retry the request, it is possible for a customer to receive multiple messages or calls from your application."
Proposal
Therefore, I'd like to request that Twilio internally to have the 26 second timeout reviewed, and possibly grant a global option within the Twilio client to reduce this timeout for an account
Regular API requests, like phone number validation, 10 seconds is fine. There's a huge unknown period of time between 10 and 30 (15 and 25 seconds) where Twilio may or may not complete a transactional request and we'd be in better shape if Twilio made that decision.
I think that having a timeout and transactional_timeout with sane defaults built in by Librarian would go a good way, even if they're opt-in.
Issue Summary
Proposal
Therefore, I'd like to request that Twilio internally to have the 26 second timeout reviewed, and possibly grant a global option within the Twilio client to reduce this timeout for an account
Regular API requests, like phone number validation, 10 seconds is fine. There's a huge unknown period of time between 10 and 30 (15 and 25 seconds) where Twilio may or may not complete a transactional request and we'd be in better shape if Twilio made that decision.
I think that having a timeout and transactional_timeout with sane defaults built in by Librarian would go a good way, even if they're opt-in.
Steps to Reproduce
Code Snippet
Exception/Log
Technical details:
Related to twilio support ticket 4562575 as suggested by Noel Gaffney