WSL: Docker Desktop's "resource saver mode" causes WSL to "lock" when AutoMemoryReclaim is set to gradual
Windows Version
Microsoft Windows [Version 10.0.22621.3007]
WSL Version
2.0.14.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
5.15.133.1-1
Distro Version
Ubuntu 22.04
Other Software
Docker Desktop 4.26.1 (131620) - Windows version
Repro Steps
When Docker Desktop is running but is in “Resource Saver” mode, running any command that has to read from the disk will “hang” until I manually “wake up” Docker from its Resource Saver mode (by running a container for example).
I’m not really sure about the “read from disk” part, but it’s been the common denominator of commands affected by this (e.g. apt, ls, lsof are all affected, while zsh scripts that are already running or top/htop aren’t).
This issue happens when Docker Desktop is running in resource saver mode AND WSL’s autoMemoryReclaim is set to gradual.
I’ve tried the following scenarios and they don’t seem to cause the issue:
autoMemoryReclaimis set todropcacheautoMemoryReclaimis disabled (commented out in.wslconfig)- Docker Desktop is running in its normal mode
- Docker Desktop isn’t running at all
For now I have autoMemoryReclaim set to dropcache, but if you want me to run additional tests or need some other info let me know.
Expected Behavior
Expected the normal command behavior.
Actual Behavior
I’ve taken a screen recording while the issue happens:
https://github.com/microsoft/WSL/assets/56894914/64ac6b36-90a3-44af-89d5-83fe4e5d864e
Diagnostic Logs
Those are the corresponding WSL logs for the screen recording:
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 27
- Comments: 21
Hi I’m an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Open similar issues:
Closed similar issues:
autoMemoryReclaim=gradual(#10497), similarity score: 0.79Of note, reproduction of this issue is even simpler than adjusting settings. Regardless of
autoMemoryReclaim, simply:wslon command line)Perhaps I lack some background information, but I don’t feel that docker’s engine being paused should make my personal WSL2 distro completely unresponsive.
Versions:
With this in mind (in addition to several other “workarounds” like attempting to disable Windows 11’s efficiency mode), my current approach is to disable “Resource Saver” in the docker settings:
I am now experiencing much less frequent freezing (None so far, as of writing…).
I am seeing the same issue in WSL 2.5.7.0 with the default settings (
.wslconfigis empty). ApparentlyDropCacheis the default value, and I am still seeing WSL hang. If I manually instruct Docker to wake up the engine, WSL comes back to life.I am facing the same issue. Maybe related to #10378
It’s related to docker desktop.
https://github.com/docker/for-win/issues/14656#issuecomment-2966487210
Experiencing the same issue on WSL version: 2.5.7.0 with minimal
.wslconfig. WSL completely hangs when Docker enters resource saving mode. Started experiencing it within the last two weeks.My problem is similar but not identical. I am running WSL2 Ubuntu 22.04. I can run
lsand evenapt listwithout problem. They complete instantly. However, runningsudo apt-get updatehangs indefinitely when Docker Desktop is in “Resource Saver mode”.To fix it, all I have to do is click on the Resume button in Docker Desktop. Then
sudo apt-get updateruns instantlyNote that I also confirmed that I do have
autoMemoryReclaim=gradualset in~/.wslconfigI also just updated Docker Desktop today, and the problem persists with Docker Desktop 4.33.1 (161083)
I also see this with Ansible commands, even
ansible --version. If I restart docker or just run any docker command that contacts the daemon, the hanging commands immediately resume.