shim: don't tear down shared pod UVM on Hyper-V container restart - #2846
Open
rzlink wants to merge 1 commit into
Open
shim: don't tear down shared pod UVM on Hyper-V container restart#2846rzlink wants to merge 1 commit into
rzlink wants to merge 1 commit into
Conversation
On Hyper-V-isolated Windows pods (runhcs-wcow-hypervisor), in-place container restarts (ContainerRestartRules / RestartAllContainersOnContainerExits) fail: when a workload container exits it is not restarted in place; the pod ends up Failed. Two hcsshim/GCS issues combine to destroy the shared pod UVM. 1. Under RestartAll churn the guest GCS delivers a container's WaitForProcess exit reply late (or drops it); a crossing SIGKILL then returns hrNotFound while the wait is still pending. Process.Signal only logged "ignoring missing process", so the wait never completed and container Stop blocked forever. Force-complete the pending wait on hrNotFound so Wait()/Stop can't hang, and make an unmatched late response in recvLoop non-fatal (log and continue) rather than tearing the bridge down. 2. The KillExec 30s SIGKILL-init watchdog closed ht.host directly with no ownsHost guard, so a non-owning workload container's stuck stop tore down the shared pod UVM, killing the sandbox and its siblings. Gate the watchdog on ht.ownsHost and route teardown through closeHost so only the UVM owner may close it. Process-isolated pods are unaffected (host HCS exit path, no shared UVM). Adds unit tests for bridge.forceComplete and the non-fatal unknown-rpc path. Signed-off-by: Dawei Wei <wei.dawei.cn@gmail.com>
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.
Description
Fix in-place container restarts for Hyper-V-isolated Windows pods.
Two issues could combine to destroy the shared pod UVM:
SignalProcessreturnedhrNotFoundwhileWaitForProcessremained pending, process shutdown could block indefinitely. Force-complete the pending wait and tolerate its possible late response.ownsHostand usecloseHostfor teardown.This prevents a workload container restart from terminating the sandbox and sibling containers sharing the UVM.
Testing
go test ./internal/gcs