Portkey by default triggers retries on 5 status codes:
[429, 500, 502, 503, 504]
And for status codes other than this, you'd have to manually add them in your retry config with the
on_status_codes
param.
So here what you could do is, write your retry config like this:
{
"retry": {
"attempts": 3,
"on_status_codes": [
408, 429, 500, 502, 503, 504
]
}
}
And this will ensure that you are triggering retry on
all status codes, including when you get timed out.
Let me quickly explain why we have only 5 default status codes for retry: Since Portkey config also has fallbacks/loadbalancing logic, in many scenarios when there's a failure other than the above 5 status codes, the expected behaviour is to move on to the next target rather than trying the previous target again, and hence if you want to still retry, we expect the user to manually set it.