Skip to content

Commit 71fb58c

Browse files
committed
Added a comment
1 parent c4b048d commit 71fb58c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

client/driver/executor/executor_linux.go

+3
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ func DestroyCgroup(groups *cgroupConfig.Cgroup) error {
196196
manager := getCgroupManager(groups)
197197
if pids, perr := manager.GetPids(); perr == nil {
198198
for _, pid := range pids {
199+
// If the pid is the pid of the executor then we don't kill it, the
200+
// executor is going to be killed by the driver once the Wait
201+
// returns
199202
if pid == os.Getpid() {
200203
continue
201204
}

client/driver/executor/executor_test.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TestExecutor_DestroyCgroup(t *testing.T) {
156156
ctx := testExecutorContext(t)
157157
ctx.LogConfig.MaxFiles = 1
158158
ctx.LogConfig.MaxFileSizeMB = 300
159-
//defer ctx.AllocDir.Destroy()
159+
defer ctx.AllocDir.Destroy()
160160

161161
ctx.FSIsolation = true
162162
ctx.ResourceLimits = true
@@ -170,12 +170,6 @@ func TestExecutor_DestroyCgroup(t *testing.T) {
170170
if ps.Pid == 0 {
171171
t.Fatalf("expected process to start and have non zero pid")
172172
}
173-
go func() {
174-
_, err = executor.Wait()
175-
if err != nil {
176-
t.Fatalf("error in waiting for command: %v", err)
177-
}
178-
}()
179173
time.Sleep(200 * time.Millisecond)
180174
executor.Exit()
181175
file := filepath.Join(ctx.AllocDir.LogDir(), "web.stdout.0")

0 commit comments

Comments
 (0)