Closed Bug 1462293 Opened 7 years ago Closed 7 years ago

Call c.Wait() after c.Execute() if command is not aborted

Categories

(Taskcluster :: Workers, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: pmoore, Assigned: pmoore)

Details

Attachments

(1 file)

In bug 1458873 we learned that calling c.Wait() (for c that is a *github.com/taskcluster/generic-worker/process.Command) on an aborted command may never return. The solution was to call c.Process().Wait(). This solves the issue for when a command is aborted, but in the case it isn't, could return prematurely before logs are flushed. The solution is to call c.Execute() followed by c.Wait() in the case of a non-aborted command, and only c.Execute() in the case of an aborted command.
Assignee: nobody → pmoore
Status: NEW → ASSIGNED
(In reply to Pete Moore [:pmoore][:pete] from comment #0) > In bug 1458873 we learned that calling c.Wait() (for c that is a > *github.com/taskcluster/generic-worker/process.Command) on an aborted > command may never return. The solution was to call c.Process().Wait(). Correction: *github.com/taskcluster/generic-worker/process.Command -> *os/exec.Cmd
So it turns out this doesn't work, because calling c.Process.Wait() twice results in the second call hanging forever. I'm going to solve this problem a different way, by ensuring all subprocesses get killed. This isn't trivial to implement using win32 apis but it is trivial to implement by running taskkill.exe which comes shipped with Windows. I'll create a different bug for this.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Component: Generic-Worker → Workers
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: