Conversation
There was a problem hiding this comment.
Dispose should never throw. We should fix Kestrel
There was a problem hiding this comment.
Yes, we should fix Kestrel so it doesn't throw. That said, since Hosting will be interacting with 3rd party components here we should make it more defensive, especially when the consequence is a hang.
There was a problem hiding this comment.
Yeah what @Tratcher said. Need to fix both sides.
|
This isn't meant as a fix for the Kestrel bug. The problem it tries to solve is that the Dispose exception cannot be noticed at the moment: The I don't see it yet, but there sould be a better design here for exceptions during shutdown. Until then if a Dispose throws, this makes it possible to see the Exceptions at least. |
There was a problem hiding this comment.
We might want to use ILogger instead of going directly to the Console.
3b194b4 to
44d2b4d
Compare
There was a problem hiding this comment.
Use Environment.NewLine instead of \n?
44d2b4d to
ada59c7
Compare
There was a problem hiding this comment.
This error message formatting doesn't look right. There is an overload that takes an exception object.
ada59c7 to
6cd5744
Compare
|
Looks good. |
|
|
|
@Tragetaschen has a CLA on file AFAIK /cc @Eilon I think this is good to merge |
|
Yup CLA is good. |
Catch exceptions while disposing
Kestrel#9 revealed a shutdown problem when an exception is thrown during the final Dispose. This exception would omit setting the ManualResetEvent and the runtime would essentially deadlock.
This PR makes an exception during Dispose visible.