-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add retry on 504 Gateway Time-out and "connection closed before message completed" #198
Comments
PR for the 504: #199 |
Hi @Christof23 , Thank you for the issue and PR. What rationale is there to retry when API is down - and could potentially be down for hours until incident is resolved? |
Based on the comment, does configuring same parameter for custom |
Hi @64bit, thanks for your response. I take your point on the 504 response; however I've seen this response while other concurrent requests have gone through successfully. I'm not sure how OpenAI are configuring their infrastructure, but it seems that a 504 with their API doesn't necessarily mean the API is unavailable. For the reqwest client, I think I tried the fix with the client configuration, but I'll double check. |
Right thing to do here is contact OpenAI and report that their API is failing. Introducing retries is propagating that failure to everyone - and making library in-deterministic. That said, one thing that could be done in async-openai is propgate the payload causing deserialization error so that library users can decide what right action to perform. So |
Hi, I can see that requests are retried on a 429 too many requests status code. However on other error types there are no retries.
For example for 504 responses the response returns:
Similarly, I sometimes receive
Error: IncompleteMessage: connection closed before message completed
for some requests which are not retried. I believe this is a hyper issue: hyperium/hyper#2136The text was updated successfully, but these errors were encountered: