microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.46k stars 821 forks source link

Establishing many outgoing TCP requests in WSL results in eternal Ephemeral port exhaustion only fixed by reboot. #3311

Closed Suvega closed 6 years ago

Suvega commented 6 years ago

Windows build number :10.0.17134.112 4.4.0-17134-Microsoft

I have a python script that crawls a media rich webpage using python + chromedriver (via xming). Leaving two copies of this running for about 2-3 days will 100% of the time result in Ephemeral port exhaustion on the machine. Within 12 hours of that message in the windows system log, another warning will show (TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint).

After that, all new TCP/IP connections will fail, no additional messages will be thrown into the windows log, and the computer becomes unusable.

The port exhaustion never resolves, tcp ports are not released and only a reboot will restore functionality to the computer.

Common methods to release ports, or to determine which ports are still open show no open ports. (Both in Windows, as well as Linux).

I have a 100% repro (although it takes about 2-5days to trigger), so I'm happy to provide more information, run additional tools, etc. (I just have no idea on what you would need to dig into this)

therealkenc commented 6 years ago

2913