Author: | JamesNK |
---|---|
Assignees: | - |
Labels: | `untriaged`, `area-System.Net.Quic` |
Milestone: | - |
Open JamesNK opened 2 years ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Author: | JamesNK |
---|---|
Assignees: | - |
Labels: | `untriaged`, `area-System.Net.Quic` |
Milestone: | - |
The fix in my unit test project was to change the port to 55019.
Why 55019 works and 50019 now doesn't.... 🤷♂️
did you try to dump ports using netstat
? AFAIK this error comes from Kernel. This could be sign of some old process sticking around.
50019 with .NET 6 = works 50019 with .NET 7 = error
I flipped back and forth a number of times to check that it was changing the .NET version that triggered it and nothing else. And I changed the port to a couple of other similar values, e.g. 50018, before discovering a bigger change like 55019 worked. Perhaps msquic doesn't allow listening on a range of ports by default?
I didn't use netstat.
The QUIC_STATUS_ADDRESS_IN_USE error is coming from MsQuicListener. It's in the stacktrace.
Repo is available to test. It's very simple.
Triage: let's investigate for 7.0 and root cause this then we can decide what to do about it.
This does not look like .NET Runtime bug, the error comes from MsQuic.
I was able to reproduce this even outside MsQuic using the sample app from https://docs.microsoft.com/en-us/windows/win32/winsock/sio-acquire-port-reservation, the problematic range seems to be ports 50000-50059.
I filed issue with MsQuic to see if they can do something about it: https://github.com/microsoft/msquic/issues/2891
There is something called Port Exclusion Ranges apparently that affects this:
> netsh int ip show excludedportrange protocol=udp
Protocol udp Port Exclusion Ranges
Start Port End Port
---------- --------
50000 50059 *
55642 55741
63552 63651
* - Administered port exclusions.
Tracking by (internal) OS issue: https://microsoft.visualstudio.com/OS/_workitems/edit/40464377
Triage: There is nothing we can do. It needs to be address in the OS. Moving to Future for tracking purposes. If we see enough customers hitting it, we should document it properly.
This is documented in out troubleshooting guide.
Description
In .NET 6 I have unit tests that start a Kestrel HTTP/3 endpoint on port 50019. It works fine.
I updated the unit test to .NET 7 and it now throws QUIC_STATUS_ADDRESS_IN_USE. Why is that? Is it a bug, or intentional behavior? If it's intentional then there should be documentation about what ports can be used.
Reproduction Steps
Small modification to the empty ASP.NET Core template to add a H3 port:
Expected behavior
Works
Actual behavior
Regression?
Yes
Known Workarounds
Use a different port
Configuration
No response
Other information
No response