Skip to content

Implement --stop-timeout in wslc create|run and support -1 (infinite) timeouts - #40919

Merged
Blue (OneBlue) merged 17 commits into
masterfrom
user/oneblue/stop-timeout-fix
Jun 30, 2026
Merged

Blue (OneBlue) merged 17 commits into
masterfrom
user/oneblue/stop-timeout-fix

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change adds support for --stop-timeout and -1 timeouts (no timeout)

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

Validation Steps Performed

Copilot AI review requested due to automatic review settings June 25, 2026 22:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for --stop-timeout in wslc container create/run, including -1 to represent “no timeout”, and plumbs the value through WSLC’s container options, Docker API request/inspect schemas, and the CLI argument layer. It also adds unit/e2e coverage plus localized strings and help text for the new argument.

Changes:

  • Add --stop-timeout argument handling for wslc container create|run, validation, and help text updates.
  • Plumb stop-timeout through WSLC container options into Docker create/stop requests and surface it in inspect output.
  • Add unit tests and e2e tests covering valid/invalid stop-timeout values (including -1).

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/windows/WSLCTests.cpp Adds API-level tests for stop timeout behavior and inspect wiring.
test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Adds container run e2e tests + help output expectation for --stop-timeout.
test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp Adds container create e2e tests + help output expectation for --stop-timeout.
src/windows/wslcsession/WSLCContainer.cpp Validates/forwards stop timeout on create/stop and maps inspect StopTimeout.
src/windows/wslcsession/DockerHTTPClient.h Updates StopContainer signature to accept signed timeout.
src/windows/wslcsession/DockerHTTPClient.cpp Sends signed t= query parameter for stop timeout.
src/windows/wslc/tasks/ContainerTasks.cpp Parses --stop-timeout into container options.
src/windows/wslc/services/ContainerService.cpp Applies parsed stop timeout to WSLCContainerLauncher.
src/windows/wslc/services/ContainerModel.h Adds StopTimeout to ContainerOptions; updates stop default sentinel usage.
src/windows/wslc/commands/ContainerRunCommand.cpp Registers --stop-timeout as a supported run argument.
src/windows/wslc/commands/ContainerCreateCommand.cpp Registers --stop-timeout as a supported create argument.
src/windows/wslc/arguments/ArgumentValidation.cpp Adds integer validation for the stop-timeout argument.
src/windows/wslc/arguments/ArgumentDefinitions.h Defines the stop-timeout argument and localized description hook.
src/windows/service/inc/wslc.idl Introduces stop-timeout constants and adds StopTimeout to WSLCContainerOptions.
src/windows/inc/wslc_schema.h Extends WSLC inspect schema to include StopTimeout.
src/windows/inc/docker_schema.h Extends Docker create/inspect schema to include StopTimeout (and StopSignal in inspect config).
src/windows/common/WSLCContainerLauncher.h Adds stop-timeout setter/state with default sentinel.
src/windows/common/WSLCContainerLauncher.cpp Populates WSLCContainerOptions.StopTimeout from launcher state.
src/windows/common/APICompat.cpp Ensures compat conversion sets StopTimeout to default sentinel.
localization/strings/en-US/Resources.resw Adds localized strings for invalid stop-timeout and CLI arg description.
Comment thread test/windows/WSLCTests.cpp Outdated
Comment thread src/windows/service/inc/wslc.idl
Comment thread src/windows/service/inc/wslc.idl Outdated
Copilot AI review requested due to automatic review settings June 26, 2026 22:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Comment thread src/windows/wslcsession/WSLCContainer.cpp
Comment thread test/windows/WSLCTests.cpp Outdated
Comment thread test/windows/wslc/e2e/WSLCE2EContainerStopTests.cpp
@OneBlue
Blue (OneBlue) marked this pull request as ready for review June 27, 2026 00:18
@OneBlue
Blue (OneBlue) requested a review from a team as a code owner June 27, 2026 00:18
Copilot AI review requested due to automatic review settings June 27, 2026 00:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 8 comments.

Comment thread test/windows/WSLCTests.cpp
Comment thread test/windows/WSLCTests.cpp
Comment thread test/windows/WSLCTests.cpp
Comment thread test/windows/WSLCTests.cpp
Comment thread src/windows/wslcsession/WSLCContainer.cpp Outdated
Comment thread test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp
Comment thread test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp
Comment thread test/windows/wslc/e2e/WSLCE2EContainerStopTests.cpp

@dkbennett David Bennett (dkbennett) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a non-blocking nit about int vs long inconsistency, which doesn't seem to have a functional difference.

Comment thread src/windows/inc/docker_schema.h Outdated
Comment thread test/windows/WSLCTests.cpp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Comment thread test/windows/WSLCTests.cpp
Comment thread test/windows/WSLCTests.cpp Outdated
Comment thread test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Outdated
Comment thread src/windows/wslc/arguments/ArgumentValidation.h Outdated
Comment thread test/windows/wslc/e2e/WSLCE2EContainerStopTests.cpp
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 29, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread src/windows/service/inc/wslc.idl
@OneBlue
Blue (OneBlue) merged commit 9f1b8c8 into master Jun 30, 2026
11 checks passed
@OneBlue
Blue (OneBlue) deleted the user/oneblue/stop-timeout-fix branch June 30, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants