Enable TCP Loopback Fast Path (Windows)#416
Conversation
03f6c23 to
9cc10d0
Compare
There was a problem hiding this comment.
Libuv reference counts and uses that to determine if it can shutdown loop. OnStop unreferences thread' OnStopRude calls Dispose on all the items still referenced and they call close which hopefully unreferences them. So OnStopRuder explicitly unreferences them.
There was a problem hiding this comment.
Actually will split this to different PR
df6bc8b to
948ac69
Compare
7921731 to
d9ca2f3
Compare
|
Rebased |
|
Looks good to me, but I'll wait for @davidfowl or @halter73 to give the squirrel. |
|
More deets https://msdn.microsoft.com/en-us/library/windows/desktop/jj841212(v=vs.85).aspx
^--- suggests no side effects; when not loopback
|
|
Tested this on Windows 7, 8 and 2008 R2, both local connection and connection from another machine. Everything looks fine except I can't do a remote connection to 2008 R2. Not caused by the change though, I can't do it even without it. Might be a bug we have to look into, but I'm actually more suspicious it's something that needs to be setup correctly. |
|
Next I'll make sure this does't cause issues on Linux and Mac. |
|
Opened windows advanced firewall ports on 2008? |
|
@benaadams Thanks, that worked. For 7 and 8 I only had to create an endpoint in Azure portal, but 2008 required that extra step. |
|
@benaadams Can you rebase? |
Enable TCP Loopback Fast Path; where the IP layer is skipped, for lower latency for localhost comms, like HttpPlatformHandler+IIS reverse proxy http://blogs.technet.com/b/wincat/archive/2012/12/05/fast-tcp-loopback-performance-and-low-latency-with-windows-server-2012-tcp-loopback-fast-path.aspx Have to do it this way due to open issue in libuv Loopback fast path: libuv/libuv#489 Related: "Confirm HttpPlatformHandler uses Fast TCP Loopback" aspnet/IISIntegration#29
39ec0f5 to
020e0b9
Compare
|
Rebased |
|
@benaadams Yep, hanging here too. For me it's hanging before the test summary is displayed. |
|
@benaadams Have you see this in any of your runs? |
|
Wow, never - coreclr bug? Are you on later feed? What runtime, OS? |
|
Win10, volatile feed. This is on CoreCLR. |
|
Was using ci; trying volatile |
|
How are you using ci without hitting this:
? |
|
Used the dotnet feed for something else; think it put it in my local cache |
|
Freezing at first test summary on volatile rather than second :( |
|
Removing calls to |
| var socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp); | ||
| if (PlatformApis.IsWindows) | ||
| { | ||
| const int SIO_LOOPBACK_FAST_PATH = (-1744830448); |
There was a problem hiding this comment.
Copy paste code from the blog post on example.
|
🚢 after removing offending lines. |
D'oh... double connect |
f04455f to
ffa8f3f
Compare
|
Removed lines, made the changes - never saw the error as couldn't get to that point in tests :( |
|
@benaadams Still seeing hangs? |
Yep; but see hangs with everything. Tried #633 to resolve them, didn't help. Not sure if its kestrel shutdown, tests, xunit or dotnet stuff - but started happening for me on move to dotnet from dnx. Know which is the xunit repo that the tests reference? |
|
This is the runner that we're using: https://github.com/xunit/xunit/tree/master/src/xunit.console |
|
Once #623 is merged the hands should be gone. As far as this PR goes, everything looks good now. |



Enable TCP Loopback Fast Path; where the IP layer is skipped, for lower latency for localhost comms. For example when fronted by the HttpPlatformHandler+IIS reverse proxy
TCP Loopback Fast Path reference: http://blogs.technet.com/b/wincat/archive/2012/12/05/fast-tcp-loopback-performance-and-low-latency-with-windows-server-2012-tcp-loopback-fast-path.aspx
Recommended work around for open issue in libuv "Enable Fast TCP Loopback on Win" libuv/libuv#489
Related: "Confirm HttpPlatformHandler uses Fast TCP Loopback" aspnet/IISIntegration#29
Resolves #420