Commit 71fb58c 1 parent c4b048d commit 71fb58c Copy full SHA for 71fb58c
File tree 2 files changed +4
-7
lines changed
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,9 @@ func DestroyCgroup(groups *cgroupConfig.Cgroup) error {
196
196
manager := getCgroupManager (groups )
197
197
if pids , perr := manager .GetPids (); perr == nil {
198
198
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
199
202
if pid == os .Getpid () {
200
203
continue
201
204
}
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ func TestExecutor_DestroyCgroup(t *testing.T) {
156
156
ctx := testExecutorContext (t )
157
157
ctx .LogConfig .MaxFiles = 1
158
158
ctx .LogConfig .MaxFileSizeMB = 300
159
- // defer ctx.AllocDir.Destroy()
159
+ defer ctx .AllocDir .Destroy ()
160
160
161
161
ctx .FSIsolation = true
162
162
ctx .ResourceLimits = true
@@ -170,12 +170,6 @@ func TestExecutor_DestroyCgroup(t *testing.T) {
170
170
if ps .Pid == 0 {
171
171
t .Fatalf ("expected process to start and have non zero pid" )
172
172
}
173
- go func () {
174
- _ , err = executor .Wait ()
175
- if err != nil {
176
- t .Fatalf ("error in waiting for command: %v" , err )
177
- }
178
- }()
179
173
time .Sleep (200 * time .Millisecond )
180
174
executor .Exit ()
181
175
file := filepath .Join (ctx .AllocDir .LogDir (), "web.stdout.0" )
You can’t perform that action at this time.
0 commit comments