We are observing an unexpected behaviour of Apigee, When we are receiving 503 Service unavailable from downstream, there is another transaction with same requestID.
In the above case there are 2 transactions at Apigee for the same request, but we hit the request only once from postman. And we also tried form browser and jmeter, we are getting the same two transactions for a single request. So, what is the reason behind two transactions happening at Apigee for a single request.
Do you have a loadbalancer configured in the TargetEndpoint? and Does it perform Retry? You could get multiple requests sent from Apigee to the target, if you have a loadbalancer and if Retry is not disabled.
By extending our analysis, 2 transactions are happening for a single request in case of 503 error from downstream only if the request methods are GET or HEAD
We’ve an answer on this after working with Google:
Here is a brief summary of the case:
You inquired about some retries appearing on your debug sessions when only one request was sent which caused an impact on your testing environment.
During the investigation we went through:
Testing and reproducing your situation.
Consulting with an Apigee expert to address if the behaviour was expected.
Finding out this behaviour is an expected behaviour of the External Global Application Load Balancer.
As it explains on the documentation for the load balancer this behaviour happens when there is no retry policy enabled, so the solution to it, is overriding the policy with one with no amount of retries.
To disable:
I have found out the following solution to disable the retry behaviour:
Get the load balancer ID from the following command, the “id”. [1]
With this information we can make a patch to the following endpoint with a body that will override the retry policy in order to disable it. [2] [3]
By performing these actions the debug session should no longer show automatic retries from the load balancer.