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
|
diff := st.Requests - lastRequests
|
||||||
// We assume that there were no client requests to nginx, if and only if
|
// 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.
|
// 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,
|
// 1 is to account for our own stub_status request from this method.
|
||||||
// and the other 1 is to account for the readinessProbe.
|
noChange := 0 <= diff && diff <= 1
|
||||||
// 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
|
|
||||||
if noChange {
|
if noChange {
|
||||||
noChangeTimes++
|
noChangeTimes++
|
||||||
if noChangeTimes >= waitUntilNoConnectionsFor {
|
if noChangeTimes >= waitUntilNoConnectionsFor {
|
||||||
|
|
|
@ -68,7 +68,7 @@ var _ = framework.IngressNginxDescribe("[Shutdown] Asynchronous shutdown", func(
|
||||||
// therefore we are still receiving traffic while shutting down
|
// therefore we are still receiving traffic while shutting down
|
||||||
go func() {
|
go func() {
|
||||||
defer ginkgo.GinkgoRecover()
|
defer ginkgo.GinkgoRecover()
|
||||||
for i := 0; i < 120; i++ {
|
for i := 0; i < 30; i++ {
|
||||||
f.HTTPDumbTestClient().
|
f.HTTPDumbTestClient().
|
||||||
GET("/").
|
GET("/").
|
||||||
WithURL(fmt.Sprintf("http://%s/", ip)).
|
WithURL(fmt.Sprintf("http://%s/", ip)).
|
||||||
|
@ -76,7 +76,7 @@ var _ = framework.IngressNginxDescribe("[Shutdown] Asynchronous shutdown", func(
|
||||||
Expect().
|
Expect().
|
||||||
Status(http.StatusOK)
|
Status(http.StatusOK)
|
||||||
|
|
||||||
framework.Sleep(250 * time.Millisecond)
|
framework.Sleep(time.Second)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue