Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] dapr stop should wait until process actually exits #1160

Open
philliphoff opened this issue Jan 5, 2023 · 8 comments
Open

[Proposal] dapr stop should wait until process actually exits #1160

philliphoff opened this issue Jan 5, 2023 · 8 comments
Assignees
Labels
area/cli good first issue Good for newcomers kind/enhancement enhancement to an existing feature P1 size/S 1 week of work triaged/resolved The issue has been triaged
Milestone

Comments

@philliphoff
Copy link
Contributor

Describe the proposal

Currently the dapr stop command executes a kill command (or equivalent, for Windows) to stop a dapr or daprd process. However, this is asynchronous; the process may still take some time to actually exit. Scripts or other tooling that use the dapr stop command may have an expectation that, upon completion of dapr stop, processes have actually exited.

dapr stop should ensure that the process has exited before the command itself exits (within a suitable or perhaps configurable timeout).

Release Note

RELEASE NOTE:

@philliphoff philliphoff added the kind/proposal A new proposal to be considered label Jan 5, 2023
@mukundansundar mukundansundar added area/cli P1 size/S 1 week of work kind/enhancement enhancement to an existing feature and removed kind/proposal A new proposal to be considered labels Jan 10, 2023
@dapr-bot
Copy link
Collaborator

dapr-bot commented Feb 9, 2023

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale label Feb 9, 2023
@mukundansundar mukundansundar added triaged/resolved The issue has been triaged and removed stale labels Feb 13, 2023
@mukundansundar mukundansundar added this to the v1.11 milestone Feb 13, 2023
@mukundansundar
Copy link
Collaborator

I think adding a --wait,-w flag for stop with a default timeout will be good. Additionally, after the configured timeout, the process should be checked again to make sure it has exited.

@mukundansundar mukundansundar modified the milestones: v1.11, v1.12 Apr 19, 2023
@mukundansundar mukundansundar added the good first issue Good for newcomers label Sep 15, 2023
@mukundansundar mukundansundar modified the milestones: v1.12, v1.13 Sep 15, 2023
@sicoyle sicoyle moved this from Triaged to In Progress in Grace Hopper Conference 2023 Sep 22, 2023
@nikitasarawgi
Copy link

/assign

@nikitasarawgi
Copy link

So the ideal solution here would be a --wait flag (along with other flags like run-file) with a default timeout of say, 30 seconds? (please feel free to suggest a better value). Once this time has passed, the process should be checked to confirm if they have been successfully killed. In either case, whether they have been killed or not, we just log the status and go ahead with the completion of dapr stop?

@alicejgibbons
Copy link

maybe slightly less for the default value? like 15 seconds but otherwise I think sounds good IMO

@ItalyPaleAle
Copy link
Contributor

@nikitasarawgi to my understanding:

  • When dapr stop is invoked, it should send a SIGTERM to the app (like it does today)
  • It then waits for the app to exit cleanly
  • If the app doesn't exit cleanly within the timeout defined in --wait, then the Dapr CLI forcefully kills the process (SIGKILL)

See SIGKILL vs SIGTERM: https://askubuntu.com/a/481173

@sicoyle
Copy link
Contributor

sicoyle commented Sep 22, 2023

maybe slightly less for the default value? like 15 seconds but otherwise I think sounds good IMO

+1 on 15 sec

@yaron2
Copy link
Member

yaron2 commented Sep 22, 2023

Hi @nikitasarawgi, I agree the --wait flag is a good way to solve this. The flow described by ItalyPaleAle makes sense.

@mukundansundar mukundansundar added this to the v1.14 milestone Feb 8, 2024
@antontroshin antontroshin modified the milestones: v1.14, v1.15 Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli good first issue Good for newcomers kind/enhancement enhancement to an existing feature P1 size/S 1 week of work triaged/resolved The issue has been triaged
Projects
No open projects
Status: In Progress
9 participants