You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows ProcessContainer does not document how process.timeout relates to process-tree teardown. Callers can see an unbounded WaitForSingleObject in the runner and a 5-second job drain that is only a warning, and they cannot tell which of those waits the request controls.
For the native runner's blocking wait, process.timeout values 0 and 4294967295 have no deadline. That deadline bounds the wait for the root to exit on its own. In-process Node handles, Node ProcessContainer PTY, and .NET handles apply the field differently. The page states those cases.
After that, TerminateJobObject runs, job accounting is polled for 5 seconds, and a job that is still not empty is an stderr warning. The exit code or the timeout result is not replaced.
The root process handle is then waited with no deadline, on both wait and Drop, before the sandbox is released. No request field bounds that wait or confirms every descendant has exited.
Job-setup failure and ResumeThread failure are launch failures. The resume failure uses the strict 5-second drain.
There is no caller-facing job handle or custodian. JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE runs when the runner closes the job, which is after that root wait returns.
The waits are the same on every host where this backend runs. Schema version does not pick a different one.
Documentation only. Compared with get_timeout_milliseconds, kill_process_tree, terminate_and_reap, the job-setup and ResumeThread failure paths, and JOB_EMPTY_WAIT_TIMEOUT in the current runner. Also compared Node in-process polling, Node ProcessContainer spawnWithPty, and .NET Wait / WaitAsync. No runtime test.
No spec: this describes behavior that is already shipped. No schema, API, or enforcement change.
Checklist
Linked to an issue
No spec is required: documentation of existing termination waits
Updated documentation
Bug fix is not the type; this is a task that answers a documentation request
process.timeout bounds only the wait for the root to exit. After
TerminateJobObject, job accounting is polled for 5 seconds and a
remaining process is a stderr warning. The root handle is then waited
with no deadline before the call returns.
Answer the questions in issue 1532 in the processcontainer backend doc
and point schema readers at it.
Closesmicrosoft#1532
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved documentation errors misrepresent timeout behavior, termination and cleanup guarantees, and warning reliability across backends and execution paths.
4294967295 is an infinite WaitForSingleObject, and 0 is converted
to that same value. Each kill polls the job for up to 5 seconds.
try_wait does not enforce the timeout. A failed TerminateJobObject
skips the root wait. The stderr warning is best-effort host output.
Node ProcessContainer PTY does not report timedOut.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The documentation contains misleading timeout and cancellation claims that could cause callers to misunderstand deadline enforcement and whether workloads have terminated.
Cancellation can return while the sandbox is still active: .NET V1 MxcContainer.RunAsync cancellation stops awaiting native execution, and MxcProcess.WaitAsync cancellation does not kill the workload. Document this distinction from a completed native wait, and point callers to Kill or Dispose on a live process handle when termination is needed. Neither operation guarantees bounded settlement.
The opening sentence now says this page describes the native runner
wait. 4294967295 is infinite only for that blocking wait. Node and
.NET MxcProcess handles measure it from handle creation. WSL Container
and LXC also treat 0 as no timeout. W365 Agents remains the service
that picks a finite default.
Node ProcessContainer spawnWithPty forwards the request to wxc-exec, so
0 and 4294967295 have no deadline on that path. An in-process Node
handle still measures a positive value, including 4294967295, from
creation. .NET checks that same value only while Wait or WaitAsync is
running.
The schema section keeps the timeout-versus-teardown distinction and
links to the backend page for the values.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The documentation overstates deadline enforcement, describes unsupported .NET PTY creation, and omits that cancelling .NET waits can leave child processes running without explicit cleanup.
- For the native runner's blocking `wait`, `0` and `4294967295` both wait with no deadline. The runner passes `4294967295` to `WaitForSingleObject`, and that value is `INFINITE`. `0` is converted to the same value before the wait.
- For that same `wait`, `1` through `4294967294` are finite waits, in milliseconds.
- An in-process Node `MxcProcess` measures a positive timeout, including `4294967295`, from handle creation. Polling starts when the handle is created and enforces that deadline until the handle settles.
- For that same `wait`, `1` through `4294967294` are finite waits, in milliseconds.
- An in-process Node `MxcProcess` measures a positive timeout, including `4294967295`, from handle creation. Polling starts when the handle is created and enforces that deadline until the handle settles.
- Node ProcessContainer `spawnWithPty` does not start that deadline. It passes the request to `wxc-exec`, so the native runner rules above apply on that path. `0` and `4294967295` have no deadline there.
- A .NET `MxcProcess`, including its PTY handle, measures a positive timeout, including `4294967295`, from handle creation. `0` sets no managed deadline. The deadline is checked only while `Wait` or `WaitAsync` runs. `TryGetExitCode` does not enforce it, so a process that is not being waited on can run past the deadline.
- For the native runner's blocking `wait`, `0` and `4294967295` both wait with no deadline. The runner passes `4294967295` to `WaitForSingleObject`, and that value is `INFINITE`. `0` is converted to the same value before the wait.
- For that same `wait`, `1` through `4294967294` are finite waits, in milliseconds.
- An in-process Node `MxcProcess` measures a positive timeout, including `4294967295`, from handle creation. Polling starts when the handle is created and enforces that deadline until the handle settles.
- Node ProcessContainer `spawnWithPty` does not start that deadline. It passes the request to `wxc-exec`, so the native runner rules above apply on that path. `0` and `4294967295` have no deadline there.
- A .NET `MxcProcess`, including its PTY handle, measures a positive timeout, including `4294967295`, from handle creation. `0` sets no managed deadline. The deadline is checked only while `Wait` or `WaitAsync` runs. `TryGetExitCode` does not enforce it, so a process that is not being waited on can run past the deadline.
For a completed runner `wait`, a returned exit code or a returned timeout means the root process handle was signaled. It does not mean a 5-second poll saw zero active processes.
This branch has not been deployed
No deployments
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
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.
Description
Windows ProcessContainer does not document how
process.timeoutrelates to process-tree teardown. Callers can see an unboundedWaitForSingleObjectin the runner and a 5-second job drain that is only a warning, and they cannot tell which of those waits the request controls.This adds ProcessContainer process termination and a short pointer from the schema. It records the current behavior:
wait,process.timeoutvalues0and4294967295have no deadline. That deadline bounds the wait for the root to exit on its own. In-process Node handles, Node ProcessContainer PTY, and .NET handles apply the field differently. The page states those cases.TerminateJobObjectruns, job accounting is polled for 5 seconds, and a job that is still not empty is an stderr warning. The exit code or the timeout result is not replaced.waitandDrop, before the sandbox is released. No request field bounds that wait or confirms every descendant has exited.ResumeThreadfailure are launch failures. The resume failure uses the strict 5-second drain.JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSEruns when the runner closes the job, which is after that root wait returns.References
Closes #1532
Validation
Documentation only. Compared with
get_timeout_milliseconds,kill_process_tree,terminate_and_reap, the job-setup andResumeThreadfailure paths, andJOB_EMPTY_WAIT_TIMEOUTin the current runner. Also compared Node in-process polling, Node ProcessContainerspawnWithPty, and .NETWait/WaitAsync. No runtime test.No spec: this describes behavior that is already shipped. No schema, API, or enforcement change.
Checklist
Issue Type
Microsoft Reviewers: Open in CodeFlow