mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #4918 from vmarmol/handle-crash
Handle crash in per-pod thread and container killer.
This commit is contained in:
commit
0fec31a11e
@ -974,6 +974,7 @@ func (kl *Kubelet) killContainersInPod(pod *api.BoundPod, dockerContainers docke
|
||||
count++
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer util.HandleCrash()
|
||||
err := kl.killContainer(dockerContainer)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to delete container: %v; Skipping pod %q", err, podFullName)
|
||||
|
@ -23,6 +23,7 @@ import (
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/dockertools"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
@ -104,7 +105,10 @@ func (p *podWorkers) UpdatePod(pod *api.BoundPod, updateComplete func()) {
|
||||
// update of this pod is being processed are ignored.
|
||||
podUpdates = make(chan workUpdate, 1)
|
||||
p.podUpdates[uid] = podUpdates
|
||||
go p.managePodLoop(podUpdates)
|
||||
go func() {
|
||||
defer util.HandleCrash()
|
||||
p.managePodLoop(podUpdates)
|
||||
}()
|
||||
}
|
||||
// TODO(wojtek-t): Consider changing to the following model:
|
||||
// - add a cache of "desired" pod state
|
||||
|
Loading…
Reference in New Issue
Block a user