-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Graceful shutdown for the API server (#18642)
Closes #18642 Implements a graceful shutdown the the API server. Without this, ArgoCD API server will eventually return 502 during rolling update. However, healthcheck would return 503 if the server is terminating. Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com> Co-authored-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
- Loading branch information
1 parent
8bce61e
commit a8ca06a
Showing
5 changed files
with
246 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package e2e | ||
|
||
import ( | ||
"io" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/argoproj/argo-cd/v2/test/e2e/fixture" | ||
. "github.com/argoproj/argo-cd/v2/test/e2e/fixture" | ||
) | ||
|
||
func TestAPIServerGracefulRestart(t *testing.T) { | ||
EnsureCleanState(t) | ||
|
||
resp, err := DoHttpRequest("GET", "/healthz?full=true", "") | ||
require.NoError(t, err) | ||
responseData, err := io.ReadAll(resp.Body) | ||
require.NoError(t, err) | ||
require.Equal(t, "ok\n", string(responseData)) | ||
fixture.RestartAPIServer() | ||
resp, err = DoHttpRequest("GET", "/healthz?full=true", "") | ||
require.NoError(t, err) | ||
responseData, err = io.ReadAll(resp.Body) | ||
require.NoError(t, err) | ||
require.Equal(t, "ok\n", string(responseData)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters