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:

  • autoMemoryReclaim is set to dropcache
  • autoMemoryReclaim is 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:

WslLogs-AutoMemReclaim-Gradual-2024-01-23_20-40-10.zip

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 27
  • Comments: 21

Most upvoted comments

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:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Of note, reproduction of this issue is even simpler than adjusting settings. Regardless of autoMemoryReclaim, simply:

  1. Run WSL (wsl on command line)
  2. Run Docker Desktop
  3. Hit the “Pause” button on the “Engine running” section in Docker Desktop (imaged above, resource saver can cause this).
  4. WSL will be frozen at any point this pause is active, and resumes once unpaused.

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:

Ubuntu: 24.04.1 LTS
Docker Desktop version: 4.41.2
WSL version: 2.5.7.0
Kernel version: 6.6.87.1-1
WSLg version: 1.0.66
MSRDC version: 1.2.6074
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22621.5335

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:

Image

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 (.wslconfig is empty). Apparently DropCache is 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

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 ls and even apt list without problem. They complete instantly. However, running sudo apt-get update hangs 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 update runs instantly

image

Note that I also confirmed that I do have autoMemoryReclaim=gradual set in ~/.wslconfig

> wsl -v
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4037

I also just updated Docker Desktop today, and the problem persists with Docker Desktop 4.33.1 (161083)

$ docker --version
Docker version 27.1.1, build 6312585

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.