Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Regression on stopping the server #111

Closed
muratg opened this issue Jun 22, 2015 · 9 comments
Closed

Regression on stopping the server #111

muratg opened this issue Jun 22, 2015 · 9 comments
Assignees
Milestone

Comments

@muratg
Copy link
Contributor

muratg commented Jun 22, 2015

"For every web template when the server is started with dnx . kestrel I used to be able to hit q or CTRL+C. The only way I've found to stop the server is with CTRL+Z but that keep the port in use. So on the next usage of dnx . kestrel you get a port in use error. More info at OmniSharp/generator-aspnet#191 (comment)."

@muratg muratg added this to the 1.0.0-beta5 milestone Jun 22, 2015
@muratg
Copy link
Contributor Author

muratg commented Jun 22, 2015

@halter73 Can you have a look for Beta5? If we can have a contained fix in Kestrel package only, we should be able to take this in Beta 5.

cc @danroth27 @DamianEdwards

@Tragetaschen
Copy link
Contributor

#9?

Also note that CTRL+Z merely pauses the process and puts it in the background. From there, you could work with it using the bg and fg command line tools. It's natural that the port isn't released as the process continues to live.

@sayedihashimi
Copy link

@Tragetaschen I think #9 is a different issue. This was working on Mac in beta3/4. #9 was filed over a year ago.

@Tragetaschen
Copy link
Contributor

The reason this becomes visible now is that Hosting was changed. Up until beta4, the clean way to exit the process was to press Enter (Console.ReadLine). Now with beta5, this was changed to CTRL+C (Console.CancelKeyPress).

Prior to beta5, CTRL+C would kill the process without proper cleanup. Pressing it was using the equivalent of Environment.Exit and at most the finalizers of the objects would run (if at all). Now, with beta5, CTRL+C shuts down the program using the expected code paths and properly calls Dispose on all objects including the Kestrel ones. This makes this bug visible again—it remained unfixed all the time.

@sayedihashimi
Copy link

@Tragetaschen ok I see. Let's see what @halter73 finds out in his investigation.

@muratg
Copy link
Contributor Author

muratg commented Jun 23, 2015

I think @Tragetaschen is right.

For now, workaround would be to hit Ctrl-Z to send the process to the background, and than kill it via command line (or with Activity Monitor on a Mac)

@dougbu
Copy link
Member

dougbu commented Jun 23, 2015

Just to be clear: The PR mentioned near the end of the #9 discussion (#60) has never been merged? Would it be relevant if rebased on dev?

@halter73
Copy link
Member

OnStopRude along with @Tratcher's fix in Hosting fix this issue

@muratg muratg modified the milestones: 1.0.0-beta6, 1.0.0-beta5 Jun 24, 2015
@muratg
Copy link
Contributor Author

muratg commented Jun 24, 2015

This is going in beta 6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants