-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Zuul post retry on 503 #892
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
Comments
Can you show more of your configuration please? Retries are the responsibility of ribbon in zuul. By default it only retries GET. |
Hi, After some test I push a demo with the bug running here
As you can see, post request is retried in the same second. The first one with body the second one empty I hope this helps. |
Hi, |
@yukatan no update. |
@yukatan - feels like a dup of Netflix/zuul#193 Please take a look for the suggested workaround |
Hi, |
@pradeepkusingh we will no longer use the Ribbon RestClient in Camden so this issue is not particularly valid anymore for the latest releases. Please keep all retry questions in #1290. |
Hi @ryanjbaxter , @spencergibb are there any plans to fix this bug in the near future? Of course, the workaround is outdated but we were able to adopt it into the current code (Dalson.RELEASE with Spring-Retry and spring-cloud-commons >= 1.2.3.RELEASE / spring-cloud-netflix-core >= 1.3.2.RELEASE for the 'RetryOnStatusCode feature') This means that we have a filter which replaces the request entity on the zuul request context and a modified version of the RetryableRibbonLoadBalancingHttpClient which can reset the request's input stream which was set through the ribbon request context. I was wondering why it is not adopted in spring-cloud already. Maybe the FormBodyWrapperFilter can be modified to run on any request with a payload in general (POST/PUT/PATCH, I think?) and the FormBodyRequestWrapper should be used to replace the requests's input stream with a resettable one. What do you think? |
@doernbrackandre its not on our radar at the moment, but if you would like to submit a PR with the necessary changes that would be great! |
I experienced the same issue with Dalston.SR2. The OkToRetryOnAllOperations option does not work for Requests with a body. The body is not submitted to the target for the retry. Applying the workaround suggested in (Netflix/zuul#193) seams to be dangerous for large requests because all request bodies are buffered in memory. |
There's no other way, but to buffer the body. How else would it retry with a body? |
It could be implemented in a way that the requests are only buffer up to a certain body size. If the limit is exceeded, a retry would not be possible - which is IMHO better as going out of memory even if retry is not necessary if a large request is passed. |
Modfied RibbonCommandContext to make request entity resettable. fixes gh-892
Any recommendation for fixing this i Dalston Release train? Or should we not retry post requests |
I dont see why not. @spencergibb do you see any reason why we can't backport this? |
We have a service that returns 503 responses when some dependencies are not available. We are observing that in this situation zuul retry one time.
The problem is that the request is a POST with json body and the first time the body is correctly sent, but when zuul retries, the body is sent empty and it results in a bad request to the client. We are in Angel.SR3 but the response is the same with SR6
Any idea of how to retry with body?? it seems a serius bug to me
Thanks in advance!!
The text was updated successfully, but these errors were encountered: