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

Unable to shut down via ctrl + c . #2066

Closed
techmouse84 opened this issue Nov 3, 2019 · 5 comments
Closed

Unable to shut down via ctrl + c . #2066

techmouse84 opened this issue Nov 3, 2019 · 5 comments

Comments

@techmouse84
Copy link

I tested using latest abp applictaion via cli

OS : Windows 10
abp verison : 1.0.2

PS Z:\temp\abpTemp> abp new Acme.BookStore [12:54:55 INF] ABP CLI (https://abp.io) [12:54:56 INF] Version 1.0.2 (Stable channel) [12:54:57 INF] Creating your project... [12:54:57 INF] Project name: Acme.BookStore [12:54:57 INF] Output folder: Z:\temp\abpTemp [12:54:58 INF] Downloading template: app, version: 1.0.2 [12:55:04 INF] Check out the documents at https://docs.abp.io/en/abp/latest/Startup-Templates/Application [12:55:07 INF] 'Acme.BookStore' has been successfully created to 'Z:\temp\abpTemp'

I commented out serilog so that it outputs to the console.
After the application boots up , i try to shut down via Ctrl + C.

info: Volo.Abp.Modularity.ModuleManager[0]
      Initialized all ABP modules.
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:44352
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: Z:\Temp\abpTemp\src\Acme.BookStore.Web
info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...
info: Microsoft.Hosting.Lifetime[0]
      Waiting for the host to be disposed. Ensure all 'IHost' instances are wrapped in 'using' blocks.

It appears to be blocked via ConsoleLifeTime when using the generic host builder.

private void OnProcessExit(object sender, EventArgs e)
        {
            ApplicationLifetime.StopApplication();
            if(!_shutdownBlock.WaitOne(HostOptions.ShutdownTimeout))
            {
                Logger.LogInformation("Waiting for the host to be disposed. Ensure all 'IHost' instances are wrapped in 'using' blocks.");
            }
            _shutdownBlock.WaitOne();
            // On Linux if the shutdown is triggered by SIGTERM then that's signaled with the 143 exit code.
            // Suppress that since we shut down gracefully. https://github.com/aspnet/AspNetCore/issues/6526
            System.Environment.ExitCode = 0;
        }
@maliming
Copy link
Member

maliming commented Nov 4, 2019

Maybe related to this #265

@johnnba
Copy link

johnnba commented Dec 9, 2019

yes, i got the same problem with you.
so what can we do temperarily to solve the problem. any help is appreciated, thanks.

@maliming
Copy link
Member

maliming commented Dec 9, 2019

We can only wait for #265. I did not find a temporary solution.

@hikalkan
Copy link
Member

/cc: @ebicoglu

@maliming
Copy link
Member

maliming commented Jan 7, 2020

fixed by #265

@maliming maliming closed this as completed Jan 7, 2020
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

4 participants