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

Daprd 1.5.0 does not respond to shutdown API command down in a timely fashion on Windows. #3930

Closed
badgeratu opened this issue Nov 19, 2021 · 2 comments · Fixed by #4078
Closed
Assignees
Labels
good first issue Good for newcomers kind/bug Something isn't working P1 size/XS 2 days work triaged/resolved Indicates that this issue has been triaged
Milestone

Comments

@badgeratu
Copy link

In what area(s)?

/area runtime

What version of Dapr?

1.5.0

Expected Behavior

On Windows 10 sending the POST HTTP shutdown command to /v1.0/shutdown should shut down the daprd.exe process in around 5 seconds.

Actual Behavior

The sidecar does not shut down in a timely fashion unless the same command is re-executed and then it forcibly shuts down after 5 seconds.

Steps to Reproduce the Problem

With a clean installation of dapr 1.5.0 using dapr init on Windows 10, run the following command (assuming port 80 is an open HTTP port on the machine):

daprd.exe --app-id demo --dapr-http-port 3500 --app-port 80 --log-level debug

Once it has started make an empty HTTP POST call to http://localhost:3500/v1.0/shutdown, wait 60 seconds then send the same call again to actually shut it down. The following log messages should be observed (with comments added prefixed by ##):

## Dapr Started
time="2021-11-19T17:31:28.1915287Z" level=info msg="starting Dapr Runtime -- version 1.5.0 -- commit 83fe579f5dc93bef1ce3b464d3167a225a3aff3a" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:31:28.2964495Z" level=info msg="dapr initialized. Status: Running. Init Elapsed 95.86970000000001ms" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0

## Sent http://localhost:3500/v1.0/shutdown
time="2021-11-19T17:31:40.2926015Z" level=info msg="Shutting down actor" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:31:40.2931354Z" level=info msg="dapr shutting down." app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:31:40.2931354Z" level=info msg="Stopping Dapr APIs" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0

## 63 seconds later no change, repeated send of http://localhost:3500/v1.0/shutdown
time="2021-11-19T17:32:43.883986Z" level=info msg="Shutting down actor" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:32:43.8845826Z" level=info msg="dapr shutting down." app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:32:43.8845826Z" level=info msg="Stopping Dapr APIs" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:32:43.9086103Z" level=info msg="Waiting 5s to finish outstanding operations" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:32:43.9086103Z" level=info msg="Waiting 5s to finish outstanding operations" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0
time="2021-11-19T17:32:48.9189706Z" level=info msg="Shutting down all components" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.5.0

## Dapr has now closed successfully

When doing exactly the same approach using dapr 1.4.3, the second POST call is not required and the following log messages are observed:

## Dapr Started
time="2021-11-19T18:00:21.2112666Z" level=info msg="starting Dapr Runtime -- version 1.4.3 -- commit a8ee30180e1183e2a2e4d00c283448af6d73d0d0" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.4.3
time="2021-11-19T18:00:21.3082046Z" level=info msg="dapr initialized. Status: Running. Init Elapsed 86.937ms" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.4.3

## Sent http://localhost:3500/v1.0/shutdown
time="2021-11-19T18:00:25.1623406Z" level=info msg="Shutting down actor" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.4.3
time="2021-11-19T18:00:25.1628614Z" level=info msg="dapr shutting down. Waiting 5s to finish outstanding operations" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.4.3
time="2021-11-19T18:00:30.1674763Z" level=info msg="Shutting down all components" app_id=demo instance=LONL30559 scope=dapr.runtime type=log ver=1.4.3

## Dapr has now closed successfully

Release Note

RELEASE NOTE: FIX Bug in runtime. daprd does not respond to shutdown API command down in a timely fashion.

@badgeratu badgeratu added the kind/bug Something isn't working label Nov 19, 2021
@artursouza artursouza added good first issue Good for newcomers P2 size/XS 2 days work triaged/resolved Indicates that this issue has been triaged P1 and removed P2 labels Nov 23, 2021
@artursouza artursouza added this to the v1.6 milestone Nov 23, 2021
@shivamkm07
Copy link
Contributor

/assign

@shivamkm07
Copy link
Contributor

The issue stemmed from fasthttp not closing idle connections on Shutdown earlier. However, the same issue has been fixed and merged in upstream(valyala/fasthttp#1155). So just upgrading the dependency to latest commit(valyala/fasthttp@4517204) works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/bug Something isn't working P1 size/XS 2 days work triaged/resolved Indicates that this issue has been triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants