Implement --stop-timeout in wslc create|run and support -1 (infinite) timeouts - #40919
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-timeoutargument handling forwslc 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. |
David Bennett (dkbennett)
previously approved these changes
Jun 29, 2026
David Bennett (dkbennett)
left a comment
Member
There was a problem hiding this comment.
Just a non-blocking nit about int vs long inconsistency, which doesn't seem to have a functional difference.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
David Bennett (dkbennett)
previously approved these changes
Jun 30, 2026
David Bennett (dkbennett)
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
This change adds support for --stop-timeout and -1 timeouts (no timeout)
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed