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

Azure App Service on Linux seems to not perform graceful shutdown #2

Open
cmeeren opened this issue Sep 17, 2021 · 0 comments
Open

Comments

@cmeeren
Copy link

cmeeren commented Sep 17, 2021

I have several ASP.NET Core APIs that run on Azure App Service on Linux. These applications perform important work on shutdown (using IHostApplicationLifetime.ApplicationStopping). This work takes just a couple of seconds to complete, so shutdown timeouts should not be relevant.

When I run the APIs locally and use Ctrl-C to shutdown the API, this work is performed correctly. However, when restarting the APIs in Azure, whether by deploying new versions or manually restarting the app service through the Azure Portal, the shutdown tasks seem to never run. It is almost as if Azure App Service just kills the container or process something when I click "Stop" or "Restart" in the Azure Portal.

Is this intended?

Note that this problem does not exist on Azure App Service for Windows. There, the shutdown work is performed correctly.

Possibly related:

dotnet/aspnetcore#18259

aspnet/AspNetCoreModule#115

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

No branches or pull requests

1 participant