Skip to content

Commit

Permalink
Added a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed Mar 2, 2016
1 parent c4b048d commit 71fb58c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 3 additions & 0 deletions client/driver/executor/executor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ func DestroyCgroup(groups *cgroupConfig.Cgroup) error {
manager := getCgroupManager(groups)
if pids, perr := manager.GetPids(); perr == nil {
for _, pid := range pids {
// If the pid is the pid of the executor then we don't kill it, the
// executor is going to be killed by the driver once the Wait
// returns
if pid == os.Getpid() {
continue
}
Expand Down
8 changes: 1 addition & 7 deletions client/driver/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestExecutor_DestroyCgroup(t *testing.T) {
ctx := testExecutorContext(t)
ctx.LogConfig.MaxFiles = 1
ctx.LogConfig.MaxFileSizeMB = 300
//defer ctx.AllocDir.Destroy()
defer ctx.AllocDir.Destroy()

ctx.FSIsolation = true
ctx.ResourceLimits = true
Expand All @@ -170,12 +170,6 @@ func TestExecutor_DestroyCgroup(t *testing.T) {
if ps.Pid == 0 {
t.Fatalf("expected process to start and have non zero pid")
}
go func() {
_, err = executor.Wait()
if err != nil {
t.Fatalf("error in waiting for command: %v", err)
}
}()
time.Sleep(200 * time.Millisecond)
executor.Exit()
file := filepath.Join(ctx.AllocDir.LogDir(), "web.stdout.0")
Expand Down

0 comments on commit 71fb58c

Please sign in to comment.