Skip to content

Conversation

@OneBlue
Copy link
Collaborator

@OneBlue OneBlue commented Sep 24, 2025

Summary of the Pull Request

If the OOBE process for a WSL1 distros takes more than 30 seconds, we'll hit the LAUNCH_PROCESS_DEFAULT_TIMEOUT_MS timeout which will cause the channel to be closed, which will fail the OOBE, causing all sorts of issues.

This change removes the timeout for this specific transaction, so we don't fail WSL1 OOBE if it takes more than 30 seconds to complete

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

This issue could cause OOBE failures looking like this:

λ wsl --install <distro> --version 1
Installing: <distro>
Distribution successfully installed. It can be launched via 'wsl.exe -d  <distro>'
Launching  <distro>...
Provisioning the new WSL instance <distro>
This might take a while...

<After 30 seconds>
<3>WSL (10 - SessionLeader) ERROR: SendMessage:131: Failed to write message LxInitOobeResult. Channel: OOBE
<3>WSL (10) ERROR: Broken pipe @src/shared/inc\SocketChannel.h:132 (SendMessage)
<3>WSL (10 - SessionLeader) ERROR: CreateProcessCommon:805: Create process failed

Validation Steps Performed

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a timeout issue in WSL1 OOBE (Out of Box Experience) where the process would fail if it took longer than 30 seconds to complete, which could happen when waiting for user input.

  • Removes the default 30-second timeout for OOBE message reception by passing INFINITE timeout
  • Refactors timeout handling to use a configurable parameter instead of hardcoded constants
  • Centralizes timeout value definition to improve maintainability

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
LxssInstance.cpp Updates OOBE message reception to use infinite timeout with explanatory comment
LxssMessagePort.h Adds configurable timeout parameter to Receive method and defines default timeout constant
LxssMessagePort.cpp Implements timeout parameter in Receive method and replaces hardcoded timeout values

void LxssMessagePort::WaitForMessage(_In_ PIO_STATUS_BLOCK IoStatus, _In_ DWORD Timeout) const
{
const DWORD WaitStatus = WaitForSingleObject(m_messageEvent.get(), LAUNCH_PROCESS_DEFAULT_TIMEOUT_MS);
const DWORD WaitStatus = WaitForSingleObject(m_messageEvent.get(), Timeout);
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WaitForMessage function parameter Timeout is not being used - it's using the passed Timeout parameter instead of the method's own Timeout parameter. This could cause issues if callers expect the method's Timeout parameter to be respected.

Copilot uses AI. Check for mistakes.
@OneBlue OneBlue merged commit 332efe1 into master Sep 25, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants