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

(Web) Application does not exit gracefully when receiving SIGTERM #79

Closed
agross opened this issue Mar 27, 2023 · 0 comments
Closed

(Web) Application does not exit gracefully when receiving SIGTERM #79

agross opened this issue Mar 27, 2023 · 0 comments

Comments

@agross
Copy link
Contributor

agross commented Mar 27, 2023

This is the Program.cs of a new web application minus the unnecessary defaults.

using Oakton;

var builder = WebApplication.CreateBuilder(args);

builder.Host.ApplyOaktonExtensions();

var app = builder.Build();

return await app.RunOaktonCommands(args);

When the application is started and a SIGTERM is sent (kill -TERM <pid>), the shutdown hangs indefinitely:

$ ./WebOakton


info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /Users/agross/Downloads/WebOakton/bin/Debug/net7.0
info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...
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