Skip to content

Hosting now requires ctrl + c to exit instead of enter #23

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

Open
davidfowl opened this issue May 12, 2015 · 10 comments
Open

Hosting now requires ctrl + c to exit instead of enter #23

davidfowl opened this issue May 12, 2015 · 10 comments

Comments

@davidfowl
Copy link
Member

This was a design change that allows command line hosting to be run without a tty

@davidfowl davidfowl added this to the 1.0.0-beta5 milestone May 12, 2015
@davidfowl davidfowl changed the title Hosting now requires ctrl + c to exit Hosting now requires ctrl + c to exit instead of enter May 12, 2015
@miguellira
Copy link

Ugh. Looks like this change brought this back aspnet/KestrelHttpServer#9

Unhandled Exception:
System.Exception: Error -16 EBUSY resource busy or locked
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Check (Int32 statusCode) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_close (Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle handle) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.ReleaseHandle () [0x00000] in <filename unknown>:0 
  at System.Runtime.InteropServices.SafeHandle.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0 
  at System.Runtime.InteropServices.SafeHandle.Finalize () [0x00000] in <filename unknown>:0 

@davidfowl
Copy link
Member Author

Nice

@hnrkndrssn
Copy link

Was that fixed?

I get that occasionally on beta4...

dnx . kestrel
Started


Unhandled Exception:
System.Exception: Error -16 EBUSY resource busy or locked
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Check (Int32 statusCode) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_close (Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle handle) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.ReleaseHandle () [0x00000] in <filename unknown>:0
  at System.Runtime.InteropServices.SafeHandle.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
  at System.Runtime.InteropServices.SafeHandle.Finalize () [0x00000] in <filename unknown>:0
dnvm list

Active Version              Runtime Arch Location             Alias
------ -------              ------- ---- --------             -----
  *    1.0.0-beta4          mono         ~/.dnx/runtimes      default
       1.0.0-beta5-11533    mono         ~/.dnx/runtimes
       1.0.0-beta5-11657    mono         ~/.dnx/runtimes
       1.0.0-beta5-11672    mono         ~/.dnx/runtimes

@miguellira
Copy link

@alfhenrik don't know. Maybe. I wasn't on beta4 on the Mac for long. Didn't come across it on beta5 until this change though. Oh well, it's all beta anyway.

@Tragetaschen
Copy link

This hasn't been resolved in Kestrel yet.

If you did CTRL+C to a running application before, then the application would call the equivalent of Environment.Exit and let the finalizers (hopefully) clean up the application, if at all. With this change now, the actual Dispose logic of Kestrel is running.

There is no difference between pressing Enter before and CTRL+C now.

@davidfowl
Copy link
Member Author

Thanks for that confirmation @Tragetaschen

@Tragetaschen
Copy link

Ah, there's one difference in behavior, though: The exception from the Dispose call isn't logged / swallowed anymore, but goes right out of Hosting's Main method to the layers above. With the "old" behavior, if you didn't use a logger like the console logger, you wouldn' see it.

@adamralph
Copy link

tty?

@uatec
Copy link

uatec commented May 13, 2015

A terminal. When running as a daemon on *nix the terminal is not available by default. For example running kestrel in docker required The container to be attached to a terminal.

@adamralph
Copy link

I see, thanks. Makes sense. I had exactly the same problem at adamralph/scriptcs-nancy#96

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

No branches or pull requests

6 participants