haproxytech / kubernetes-ingress

HAProxy Kubernetes Ingress Controller
https://www.haproxy.com/documentation/kubernetes/
Apache License 2.0
684 stars 195 forks source link

Enable L4 retries #84

Open bedis opened 4 years ago

bedis commented 4 years ago

L4 retries (option redispatch) is already enabled in defaults section. That said, it can be improve with the following items:

https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#option%20redispatch https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#retries

NickMRamirez commented 4 years ago

It would be useful to have retry-on empty-response included by default at least. During a rolling update of backend pods, new pods are added while old pods are incrementally deleted. If a client is connected to a soon-to-be deleted pod, they will likely receive a 502 response because the server would have disappeared midway through the session. This can be verified by creating a backend application that is slow and then triggering a rolling update after making a request to this application.

bedis commented 4 years ago

Hi @NickMRamirez , well, 502 also means the server "crashed" while processing the request. We don't want to enable such retry by default because we don't know the "idempotency" of the request. From my point of view, such type of retries should be configuration per service / ingress rule. (this includes all L7 retries)