Fix deadlock when task's exec start fails

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-07-13 11:13:02 +02:00
parent 9dcf725b76
commit a5b3038ccc
3 changed files with 27 additions and 11 deletions

View File

@@ -45,6 +45,7 @@ func (p *process) Start(ctx context.Context) error {
}
response, err := p.task.client.TaskService().Exec(ctx, request)
if err != nil {
p.io.Cancel()
p.io.Wait()
p.io.Close()
return err