Question
I am seeing HTTP 400 and 500 errors in my logs and want to understand the retry logic. How does Twilio Segment process retries for failed requests, and which HTTP status codes trigger a retry?
Product
Twilio Segment
Environment
Segment Console
Answer
Segment handles retries based on the HTTP status code returned by the server:
-
5xx HTTP response codes: Most 5xx codes (such as 500 Internal Server Error) will trigger a retry, as these indicate a temporary server issue.
- Exceptions: HTTP 501 and 505 will be dropped and not retried.
-
4xx HTTP response codes: Most 4xx codes (such as 400 Bad Request) will not be retried, since these usually indicate a problem with the request itself (for example, an invalid payload or write key).
- Exceptions: HTTP 408 (Request Timeout), 410 (Gone), 429 (Too Many Requests), and 460 will be retried.
- Client-side SDKs: Client-side SDKs do not retry requests that are rejected due to permanent issues, such as invalid formatting or exceeding size limits.
Additional Information
- For a deeper dive into how Segment handles retries across various edge cases, please see the Segment documentation on retries.
- If you are encountering other error codes and need to understand exactly what they mean, review the comprehensive Segment Integration Error Codes documentation.
- For additional help investigating failed deliveries and analyzing your destination logs, explore the Delivery Overview Troubleshooting guide.