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

Include port in EADDRINUSE exception #1086

Closed
DovydasNavickas opened this issue Sep 6, 2016 · 10 comments
Closed

Include port in EADDRINUSE exception #1086

DovydasNavickas opened this issue Sep 6, 2016 · 10 comments
Assignees

Comments

@DovydasNavickas
Copy link

DovydasNavickas commented Sep 6, 2016

It is not the first time I get this exception:
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -4091 EADDRINUSE address already in use

But this time I think I set the settings right and I can't seem to find the actual port Kestrel tried to use, which makes it impossible (or I don't know how) to check which port Kestrel tried to use.

It would be awesome if an exception included the port number Kestrel tried to use.

@khellang
Copy link
Contributor

khellang commented Sep 6, 2016

I really don't think this exception (or any UvException for that matter) should be surfaced to the user. What about a more specific exception here?

@khellang
Copy link
Contributor

khellang commented Sep 6, 2016

I think #299 might've been closed a bit prematurely. I'm still seeing ECONNRESET exceptions occasionally as well.

@halter73
Copy link
Member

@khellang Are you getting the ECONNRESET for reads or writes?

It's writes that should no longer fail for this reason. It's possible for reads of course if you don't get a complete request. In that case the UvException is an inner exception wrapped in an IOException.

@khellang
Copy link
Contributor

khellang commented Oct 3, 2016

@halter73 I think I saw it while awaiting a Task.Delay. Are they supposed to be logged if the client aborts the request?

@halter73
Copy link
Member

halter73 commented Oct 3, 2016

@khellang ECONNRESETs should be logged as information like any other communication error.

@DovydasNavickas
Copy link
Author

Soooo.... There shouldn't be any UvException surfaced to the user in the future builds? Or what is the bottom line of this?

@khellang
Copy link
Contributor

khellang commented Oct 4, 2016

I think there might be different interpretations on what "surfaced to the user" means.

People seem to mean two different things:

  1. A UvException is thrown and unhandled before reaching user-land.
  2. A UvException is throw, handled, logged as information and thus shows up in user-land logs.

I'm not really sure any of those should occur 😕

@DovydasNavickas
Copy link
Author

I think UvException could be left as an InnerException, because throwing information out when you have it seems like a bad idea, but the user should see a friendly IOException telling everything one needs to take action and not something that makes one go "Whaaaat?".
In this case (EADDRINUSE), exception should be an IOException saying that this particular port is in use.

@khellang
Copy link
Contributor

khellang commented Oct 4, 2016

@DovydasNavickas That's taken care of by #1143, but the ECONNRESET messages still gets logged as INFO.

@DovydasNavickas
Copy link
Author

Ok, got it. Missed the reference.

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