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.
This commit is contained in:
parent
4f43d4a78c
commit
ae42b6aeaa
2 changed files with 5 additions and 8 deletions
|
@ -417,12 +417,9 @@ func (n *NGINXController) stopWait() {
|
|||
|
||||
diff := st.Requests - lastRequests
|
||||
// We assume that there were no client requests to nginx, if and only if
|
||||
// there were 0 to 2 increase in handled requests from the last scrape.
|
||||
// 1 is to account for our own stub_status request from this method,
|
||||
// and the other 1 is to account for the readinessProbe.
|
||||
// Note that readinessProbe DO happen even when the pod is terminating.
|
||||
// See: https://github.com/kubernetes/kubernetes/issues/122824#issuecomment-1899224434
|
||||
noChange := 0 <= diff && diff <= 2
|
||||
// there were 0 to 1 increase in handled requests from the last scrape -
|
||||
// 1 is to account for our own stub_status request from this method.
|
||||
noChange := 0 <= diff && diff <= 1
|
||||
if noChange {
|
||||
noChangeTimes++
|
||||
if noChangeTimes >= waitUntilNoConnectionsFor {
|
||||
|
|
|
@ -68,7 +68,7 @@ var _ = framework.IngressNginxDescribe("[Shutdown] Asynchronous shutdown", func(
|
|||
// therefore we are still receiving traffic while shutting down
|
||||
go func() {
|
||||
defer ginkgo.GinkgoRecover()
|
||||
for i := 0; i < 120; i++ {
|
||||
for i := 0; i < 30; i++ {
|
||||
f.HTTPDumbTestClient().
|
||||
GET("/").
|
||||
WithURL(fmt.Sprintf("http://%s/", ip)).
|
||||
|
@ -76,7 +76,7 @@ var _ = framework.IngressNginxDescribe("[Shutdown] Asynchronous shutdown", func(
|
|||
Expect().
|
||||
Status(http.StatusOK)
|
||||
|
||||
framework.Sleep(250 * time.Millisecond)
|
||||
framework.Sleep(time.Second)
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in a new issue