kong icon indicating copy to clipboard operation
kong copied to clipboard

Fix/Retries times setting's idempotent method checking

Open Fijileijun opened this issue 7 years ago • 5 comments

Summary

Optimized balancer's set_more_tries's conditions, added idempotent method condition

Full changelog

  • Added idempotent checking for Calling set_more_tries .

Fijileijun avatar Sep 08 '18 16:09 Fijileijun

@jacobslei Do you see non-idempotent methods currently being retried, or is this a suggestion for a performance improvement? As of today, non-idempotent methods should already not be retried, as per the default values of the proxy_next_upstream directive. I suspect the latter, but your PR's title mentions that it is a "fix".

thibaultcha avatar Sep 10 '18 19:09 thibaultcha

@thibaultcha our cases: Under the situation that we had set proxy_next_upstream directive for upstream 500 error and set retries times more then 0 for balancer, when we sent a post method request and the upstream server return 500, the next time's retry, then the OpenResty server returned internal error page.

Fijileijun avatar Sep 12 '18 07:09 Fijileijun

"As of today, non-idempotent methods should already not be retried", it's right.
I meant, if you use ngx.balancer.set_more_retries with input parameter greater than 0 for non-idempotent request , when the upstream server return error, the OpenResty's internal error will occur.

sorry, my English is not very well 😄

Fijileijun avatar Sep 12 '18 07:09 Fijileijun

@jacobslei Oh, interesting! That would be a nice catch. Would you mind contributing a test for this behavior as well then? It will serve both as a regression test and as a way to demonstrate the issue :) And we require it in order to be able to merge your PR, accessorily... Such a test should probably live in https://github.com/Kong/kong/blob/master/spec/02-integration/05-proxy/09-balancer_spec.lua

thibaultcha avatar Sep 12 '18 17:09 thibaultcha

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


jacobs seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 01 '19 06:07 CLAassistant

Closing because of lack of activity. We would like to accept this contribution if anyone wishes to pick this back up.

hbagdi avatar Oct 25 '22 21:10 hbagdi