Skip to content

Commit c60b984

Browse files
committed
fix: We do not need to account for readinessProbe requests
since the probe is handled within ingress-nginx-controller and does not reach nginx process.
1 parent 04b44eb commit c60b984

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

internal/ingress/controller/nginx.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,9 @@ func (n *NGINXController) stopWait() {
417417

418418
diff := st.Requests - lastRequests
419419
// We assume that there were no client requests to nginx, if and only if
420-
// there were 0 to 2 increase in handled requests from the last scrape.
421-
// 1 is to account for our own stub_status request from this method,
422-
// and the other 1 is to account for the readinessProbe.
423-
// Note that readinessProbe DO happen even when the pod is terminating.
424-
// See: https://github.com/kubernetes/kubernetes/issues/122824#issuecomment-1899224434
425-
noChange := 0 <= diff && diff <= 2
420+
// there were 0 to 1 increase in handled requests from the last scrape -
421+
// 1 is to account for our own stub_status request from this method.
422+
noChange := 0 <= diff && diff <= 1
426423
if noChange {
427424
noChangeTimes++
428425
if noChangeTimes >= waitUntilNoConnectionsFor {

test/e2e/gracefulshutdown/k8s_async_shutdown.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ var _ = framework.IngressNginxDescribe("[Shutdown] Asynchronous shutdown", func(
6868
// therefore we are still receiving traffic while shutting down
6969
go func() {
7070
defer ginkgo.GinkgoRecover()
71-
for i := 0; i < 120; i++ {
71+
for i := 0; i < 30; i++ {
7272
f.HTTPDumbTestClient().
7373
GET("/").
7474
WithURL(fmt.Sprintf("http://%s/", ip)).
7575
WithHeader("Host", host).
7676
Expect().
7777
Status(http.StatusOK)
7878

79-
framework.Sleep(250 * time.Millisecond)
79+
framework.Sleep(time.Second)
8080
}
8181
}()
8282

0 commit comments

Comments
 (0)