[PR #4905] [MERGED] Force WslDistroGenerator to timeout after 10s and return Profiles #26019

Open
opened 2026-01-31 09:13:25 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4905
Author: @leonMSFT
Created: 3/13/2020
Status: Merged
Merged: 3/16/2020
Merged by: @undefined

Base: masterHead: dev/lelian/wsldistrogen


📝 Commits (3)

  • 5d90951 WSLDistroGen timeout after 15s and return profile
  • 7ed6acf wait actually 10s
  • 7d705a6 2s is the sane limit

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 src/cascadia/TerminalApp/WslDistroGenerator.cpp (+2 -2)

📄 Description

When WSL.exe would hang for users, WslDistroGenerator would also hang
while waiting for its wsl.exe --list call to return. The timeout was
INFINITE in the WaitForSingleObject call, but we should slap a
timeout on it instead (here we choose 2 seconds). In addition, if it
times out, we should also just return profiles and let the Terminal
continue to start up without the WSL distro profiles loaded.

Validation Steps Performed

Made a sleep 30 executable as the command instead, made sure it hit the
WAIT_TIMEOUT and continued to start up without loading my Ubuntu
profile.

Closes #3987


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4905 **Author:** [@leonMSFT](https://github.com/leonMSFT) **Created:** 3/13/2020 **Status:** ✅ Merged **Merged:** 3/16/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/lelian/wsldistrogen` --- ### 📝 Commits (3) - [`5d90951`](https://github.com/microsoft/terminal/commit/5d909512deb62463a4b95ef55c633b85102c8073) WSLDistroGen timeout after 15s and return profile - [`7ed6acf`](https://github.com/microsoft/terminal/commit/7ed6acfa449134f5267d381e6ccbd865ad76852f) wait actually 10s - [`7d705a6`](https://github.com/microsoft/terminal/commit/7d705a6fcd1e734ded8fed3bfe0257c37893fd2e) 2s is the sane limit ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/WslDistroGenerator.cpp` (+2 -2) </details> ### 📄 Description When WSL.exe would hang for users, WslDistroGenerator would also hang while waiting for its `wsl.exe --list` call to return. The timeout was `INFINITE` in the `WaitForSingleObject` call, but we should slap a timeout on it instead (here we choose 2 seconds). In addition, if it times out, we should also just return profiles and let the Terminal continue to start up without the WSL distro profiles loaded. # Validation Steps Performed Made a sleep 30 executable as the command instead, made sure it hit the `WAIT_TIMEOUT` and continued to start up without loading my Ubuntu profile. Closes #3987 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:13:25 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26019