Concurrent Windows stops can escalate descendant cleanup before root shutdown completes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with pkg/process/os_executor_windows.go and the shared tree-stop logic in pkg/process/os_executor.go, then read the existing Windows concurrent-stop test. Reproduce or extend coverage to distinguish native root exit from stdio-drain completion, including graceful and forced roots and descendant-held pipes. Done means the test establishes the intended descendant-escalation ordering while preserving stop ownership and bounded cancellation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Follow-up to PR #278, reviewed at c49750ffc674334831dd2b00ac807987fd2432d4. This is not a blocker for that PR; improving the sequencing is deferred because the practical impact is narrow and a safe change must preserve the separation between process exit and output draining.
Current behavior
In pkg/process/os_executor_windows.go:113–120, a caller that does not own stopping waits for descendants, but returns immediately for the root (optWaitForStdio is set):
if !shouldStopProcess && (opts&optIsResponsibleForStopping) == 0 {
if (opts & optWaitForStdio) == 0 {
// Another stop owns signaling, but descendants must still be confirmed exited.
waitErr := waitForTrackedProcessExit(ctx, handle.Pid, ws, 0)
return singleProcessStopResult{waitEndedCh: waitEndedCh}, waitErr
}
return singleProcessStopResult{waitEndedCh: waitEndedCh}, nil
}
The shared tree-stop implementation uses the returned result to decide whether to begin graceful descendant cleanup:
forceDescendants := rootResult.forceKillUsed || rootStopErr != nil || graceCtx.Err() != nil
if len(tree) > 0 && !forceDescendants {
// Begin descendant cleanup under the graceful context.
}
See pkg/process/os_executor.go:715–738. Because the joining root call returns no error and no force-kill indication, it can begin descendant cleanup while the owning caller is still waiting for the root to shut down.
For descendants whose console-event receipt is unknown, Windows normally allows a six-second passive wait before force termination. An overlapping caller can therefore start that wait early and terminate descendants while the root is still within its own 15-second graceful window. Explicit stopping overlapping process-context cancellation is one possible entry point.
Impact and confidence
The practical concern is interrupted coordinated shutdown: the root may still be arranging child shutdown when the joining caller force-kills those children, potentially cutting off their cleanup or final output. The joining caller can also time out waiting for the root while the owning stop continues.
This is not immediate force termination, and it does not directly shorten the root owner's graceful wait. This particular ownership path requires overlapping stops on the same executor. Identity validation and final exit confirmation remain in place; no wrong-process termination, false successful cleanup, or process leak has been demonstrated from this behavior.
The sequencing was verified through code inspection, not a local Windows runtime reproduction. The Windows concurrent test deliberately starts descendant stopping before releasing its gated root, so the behavior is accommodated by existing coverage rather than being entirely untested.
Follow-up direction
Determine whether concurrent Windows stops should enforce the shared root-first contract, and implement any change without waiting for output draining before descendant cleanup. A simple copy of the Unix non-owner wait is insufficient as a complete proposal: cmd.Wait() can remain blocked after root exit because descendants retain stdout/stderr pipes. The historical tree-stop design intentionally defers that completion until after descendant cleanup.
Use existing identity-aware process-exit inspection where appropriate, preserve bounded cancellation and stop ownership, and propagate the owner's force-kill outcome if needed. Cover graceful and forced roots, overlapping explicit/cancellation cleanup, and descendant-held output pipes. The regression test should distinguish native root exit from stdio-drain completion and explicitly establish the intended descendant-escalation ordering.
- Lingua principale
- Go
- Stelle
- 191
- Fork
- 26
- Merge medio
- 1g 21h
- PR unite (30g)
- 23
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/dcp
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Add application iconAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
API server: creating an Executable hangs 30-45 s (504) while the log storage restarts its parent resource watcher for ExecutablesForse già presa @danegsta l’ha presa 4 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/dcp#286 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Disable DeleteCollection for DCP resourcesForse già presa @TJ2005 l’ha presa 5 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
microsoft/dcp#206 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/dcp
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
chaitin/agent-compose#770 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
v3.8.0 vanilla manifest points to non-existent images registry.k8s.io/csi-vsphere/csi-vsphere/{driver,syncer}Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertakind/bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
kubernetes-sigs/vsphere-csi-driver#4351 ·
I maintainer di solito rispondono entro 1 giorno
-
component/gpu-kubelet-plugin component/helm needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
kubernetes-sigs/dra-driver-nvidia-gpu#1559 ·
I maintainer di solito rispondono entro 1 giorno
-
workflow: redundant goroutine in scheduleRetryForse già presa @moodbased l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 2 giorni