Skip to content

Conversation

@blakepettersson
Copy link
Member

This PR should enable the clean shutdown of the admin dashboard instead of needing to kill -9 it. Fixes #22758.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

This PR should enable the clean shutdown of the admin dashboard instead
of needing to `kill -9` it. Fixes argoproj#22758.

Signed-off-by: Blake Pettersson <[email protected]>
@blakepettersson blakepettersson requested a review from a team as a code owner June 2, 2025 21:32
@bunnyshell
Copy link

bunnyshell bot commented Jun 2, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@codecov
Copy link

codecov bot commented Jun 2, 2025

Codecov Report

❌ Patch coverage is 36.00000% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.06%. Comparing base (18ce5c2) to head (332150b).
⚠️ Report is 493 commits behind head on master.

Files with missing lines Patch % Lines
cmd/argocd/commands/headless/headless.go 0.00% 18 Missing ⚠️
cmd/argocd/commands/admin/dashboard.go 53.57% 12 Missing and 1 partial ⚠️
server/server.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #23231      +/-   ##
==========================================
+ Coverage   59.98%   60.06%   +0.07%     
==========================================
  Files         343      341       -2     
  Lines       57890    57879      -11     
==========================================
+ Hits        34727    34763      +36     
+ Misses      20381    20342      -39     
+ Partials     2782     2774       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Blake Pettersson <[email protected]>
fmt.Printf("Argo CD UI is available at http://%s:%d\n", config.Address, config.Port)
<-ctx.Done()
println("signal received, shutting down dashboard")
cancel()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe unnecessary? We already have a defer cancel. And I think we can only hit this line if the context is "done" anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I was initially thinking as well, but according to the docs of signal.NotifyContext stop() should be called as soon as the context is done, which unregisters the signal handlers.

* add assertion in test
* rename `cancel()` to `stop()` to align with notifycontext conventions

Signed-off-by: Blake Pettersson <[email protected]>
Signed-off-by: Blake Pettersson <[email protected]>
Copy link
Member

@gdsoumya gdsoumya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blakepettersson blakepettersson merged commit 6e972e4 into argoproj:master Jun 12, 2025
42 of 43 checks passed
@blakepettersson blakepettersson deleted the fix/send-signals-to-dashboard branch June 12, 2025 15:50
dsuhinin pushed a commit to dsuhinin/argo-cd that referenced this pull request Jun 16, 2025
enneitex pushed a commit to enneitex/argo-cd that referenced this pull request Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArgoCD CLI hangs when trying to close core admin dashboard

3 participants