简体   繁体   中英

Expo run from WSL causes my internet to drop out

A react native expo app run within WSL, is the cause of a very annoying bug.

A few minutes after starting the Expo project, the internet on the windows laptop stops working.

没有互联网

I found this command fixes it: Restart-Service LxssManager - when run from Powershell

However, this happens many times a day and means I have to restart the Expo project every time.

Related to: https://askubuntu.com/questions/1203412/wsl-causing-my-internet-to-not-work

Equally crazily, the fingerprint sensor on my laptop stops working and works again after that command is run.

I suspect the issue is somehow related to a very short (2-5 minute) timeout related to the react native app.

If anyone is able to point in any direction, I would love any help.

Maybe it's Expo or maybe I have some kind of local app code error. But I wouldn't know where to even start or test a bug like that.

Here is a basic run-through of what happens.

  1. Start Expo app in WSL

  2. Work, for an indefinite time

  3. If PC activity pauses for longer than 3 min, the error happens. No internet, no fingerprint sensor.

  4. Run the PowerShell command, restart the app. All is good again.

This is a known bug in WSL. Microsoft has solved this bug in build 18890. https://github.com/MicrosoftDocs/WSL/blob/live/WSL/release-notes.md#build-18890

It happens when a process in WSL creates and closes a large number of non-blocking TCP sockets, and after that some ephemeral TCP ports are leaked, eventually exhausting all ephemeral ports in both the host and the WSL.

You can try upgrading your system to version 2004 or 20H2 and see if this problem persists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM