Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 73b8c47

Browse files
committed
cleanup the legacy var stoppedChan
Signed-off-by: fupan <lifupan@gmail.com>
1 parent dccecd9 commit 73b8c47

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

daemon/pod/decommission.go

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -501,26 +501,6 @@ func (p *XPod) stopContainers(cList []string, graceful int) error {
501501
return nil
502502
}
503503

504-
/*
505-
func (p *XPod) waitStopDone(timeout int, comments string) bool {
506-
select {
507-
case s, ok := <-p.stoppedChan:
508-
if ok {
509-
p.Log(DEBUG, "got stop msg and push it again: %s", comments)
510-
select {
511-
case p.stoppedChan <- s:
512-
default:
513-
}
514-
}
515-
p.Log(DEBUG, "wait stop done: %s", comments)
516-
return true
517-
case <-utils.Timeout(timeout):
518-
p.Log(DEBUG, "wait stop timeout: %s", comments)
519-
return false
520-
}
521-
}
522-
*/
523-
524504
// waitVMStop() should only be call for the life monitoring, others should wait the `waitStopDone`
525505
func (p *XPod) waitVMStop() {
526506
p.statusLock.RLock()
@@ -542,6 +522,8 @@ func (p *XPod) waitVMStop() {
542522
}
543523
p.Log(INFO, "got vm exit event: %v", ret)
544524
}
525+
//in the future, needed to kill the sandbox and delete it here, in case
526+
//there is dad sandbox process
545527
p.cleanup()
546528
}
547529

daemon/pod/pod.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,8 @@ type XPod struct {
7070
status PodState
7171
execs map[string]*Exec
7272
statusLock *sync.RWMutex
73-
// stoppedChan: When the sandbox is down and the pod is stopped, a bool will be put into this channel,
74-
// if you want to do some op after the pod is clean stopped, just wait for this channel. And if an op
75-
// got a value from this chan, it should put an element to it again, in case other procedure may wait
76-
// on it too.
77-
stoppedChan chan bool
78-
initCond *sync.Cond
73+
74+
initCond *sync.Cond
7975

8076
//Protected by statusLock
8177
snapVolumes map[string]*apitypes.PodVolume

daemon/pod/provision.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ func newXPod(factory *PodFactory, spec *apitypes.UserPod) (*XPod, error) {
9999
execs: make(map[string]*Exec),
100100
resourceLock: &sync.Mutex{},
101101
statusLock: &sync.RWMutex{},
102-
stoppedChan: make(chan bool, 1),
103102
factory: factory,
104103
snapVolumes: make(map[string]*apitypes.PodVolume),
105104
snapContainers: make(map[string]*Container),

0 commit comments

Comments
 (0)