Open zedge-it opened 1 year ago
@zedge-it: This issue is currently awaiting triage.
If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted
label and provide further guidance.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
/assign @strongjz
Can you post the ingress object as well?
If ingress-nginx gets a request for a service it doesnt have it will send it to the default backend.
/triage needs-information
$ kubectl get ingress nginx-empty-replyserver -o yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
meta.helm.sh/release-name: nginx-empty-replyserver
meta.helm.sh/release-namespace: default
creationTimestamp: "2022-11-22T11:49:13Z"
generation: 2
labels:
app.kubernetes.io/instance: nginx-empty-replyserver
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: nginx
helm.sh/chart: nginx-13.2.13
name: nginx-empty-replyserver
namespace: default
resourceVersion: "11762"
uid: e0ca2334-82f7-4d99-968a-6098006cc094
spec:
rules:
- host: foo.bar
http:
paths:
- backend:
service:
name: nginx-empty-replyserver
port:
name: http
path: /
pathType: ImplementationSpecific
status:
loadBalancer:
ingress:
- ip: 10.98.231.89
you can disable the multiple retry (default is 3) connection to upstream with below annotation/configuration
nginx.ingress.kubernetes.io/proxy-next-upstream-tries: '1'
I met the same problem and would like to know what is the root cause of this? @strongjz
thanks~
What happened:
Ingress-controller is handling a bad request from a client, gets an empty reply from an upstream server, and ends up in a retry loop until the client disconnects.
This only happened when the ingress-controller had open keep-alive connections to the upstream servers.
What you expected to happen:
The ingress-controller should do 3 (proxy-next-upstream-tries) retries and then return a 502 to the client.
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
Kubernetes version (use
kubectl version
):How to reproduce this issue:
Use minikube
Install ingress-nginx
Install upstream service
location /die { return 444; }
location /stub_status { stub_status on; } }
Create minikube service tunnel
Warm up the keep-alive connections with valid 200 OK requests
Before the idle keep-alive connections are closed (60s), send a request that returns an empty reply
This will hang until you stop it.
Anything else we need to know:
If you disable keep-alive connections in the ingress-controller config, it will retry 3 times and return "502 Bad Gateway" as expected