Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle sidecar killing properly #1675

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions cmd/argoexec/commands/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,35 @@ func waitContainer() error {
defer stats.LogStats()
stats.StartStatsTicker(5 * time.Minute)

defer func() {
// Killing sidecar containers
err := wfExecutor.KillSidecars()
if err != nil {
log.Errorf("Failed to kill sidecars: %s", err.Error())
}
}()

// Wait for main container to complete
err := wfExecutor.Wait()
if err != nil {
wfExecutor.AddError(err)
// do not return here so we can still try to kill sidecars & save outputs
}

// Saving logs
logArt, err := wfExecutor.SaveLogs()
if err != nil {
wfExecutor.AddError(err)
// do not return here so we can still try to kill sidecars
return err
}
// Saving output parameters
err = wfExecutor.SaveParameters()
if err != nil {
wfExecutor.AddError(err)
// do not return here so we can still try to kill sidecars
return err
}
// Saving output artifacts
err = wfExecutor.SaveArtifacts()
if err != nil {
wfExecutor.AddError(err)
// do not return here so we can still try to kill sidecars
}
// Killing sidecar containers
err = wfExecutor.KillSidecars()
if err != nil {
wfExecutor.AddError(err)
return err
Expand Down