Removes stale reference to reap lock which causes a panic. (#2490)

This commit is contained in:
James Phillips 2016-11-09 09:52:07 -08:00 committed by GitHub
parent c8ec80b2b9
commit 739f91ad6a
2 changed files with 0 additions and 12 deletions

View File

@ -110,7 +110,6 @@ type CheckMonitor struct {
Interval time.Duration
Timeout time.Duration
Logger *log.Logger
ReapLock *sync.RWMutex
stop bool
stopCh chan struct{}
@ -156,12 +155,6 @@ func (c *CheckMonitor) run() {
// check is invoked periodically to perform the script check
func (c *CheckMonitor) check() {
// Disable child process reaping so that we can get this command's
// return value. Note that we take the read lock here since we are
// waiting on a specific PID and don't need to serialize all waits.
c.ReapLock.RLock()
defer c.ReapLock.RUnlock()
// Create the command
cmd, err := ExecScript(c.Script)
if err != nil {

View File

@ -11,7 +11,6 @@ import (
"os"
"os/exec"
"strings"
"sync"
"testing"
"time"
@ -46,7 +45,6 @@ func expectStatus(t *testing.T, script, status string) {
Script: script,
Interval: 10 * time.Millisecond,
Logger: log.New(os.Stderr, "", log.LstdFlags),
ReapLock: &sync.RWMutex{},
}
check.Start()
defer check.Stop()
@ -96,7 +94,6 @@ func TestCheckMonitor_Timeout(t *testing.T) {
Interval: 10 * time.Millisecond,
Timeout: 5 * time.Millisecond,
Logger: log.New(os.Stderr, "", log.LstdFlags),
ReapLock: &sync.RWMutex{},
}
check.Start()
defer check.Stop()
@ -125,7 +122,6 @@ func TestCheckMonitor_RandomStagger(t *testing.T) {
Script: "exit 0",
Interval: 25 * time.Millisecond,
Logger: log.New(os.Stderr, "", log.LstdFlags),
ReapLock: &sync.RWMutex{},
}
check.Start()
defer check.Stop()
@ -154,7 +150,6 @@ func TestCheckMonitor_LimitOutput(t *testing.T) {
Script: "od -N 81920 /dev/urandom",
Interval: 25 * time.Millisecond,
Logger: log.New(os.Stderr, "", log.LstdFlags),
ReapLock: &sync.RWMutex{},
}
check.Start()
defer check.Stop()