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

Fix jib errors on ctrl-c #1248

Merged
merged 2 commits into from
Nov 8, 2018
Merged

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Nov 7, 2018

Fixes #1247

@codecov-io
Copy link

codecov-io commented Nov 7, 2018

Codecov Report

Merging #1248 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1248   +/-   ##
=======================================
  Coverage   42.18%   42.18%           
=======================================
  Files          96       96           
  Lines        4238     4238           
=======================================
  Hits         1788     1788           
- Misses       2276     2277    +1     
+ Partials      174      173    -1
Impacted Files Coverage Δ
pkg/skaffold/jib/jib.go 83.87% <ø> (+5.08%) ⬆️
pkg/skaffold/runner/runner.go 49% <0%> (-0.4%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0badfef...3e26f29. Read the comment docs.

@@ -26,13 +26,14 @@ import (
// IsTerminatedError returns true if the error is type exec.ExitError and the corresponding process was terminated by SIGTERM
// This error is given when a exec.Command is ran and terminated with a SIGTERM.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to fix up the comments.

case *exec.ExitError:
status := exitErr.Sys().(syscall.WaitStatus)

return status.Signaled()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think SIGSEGV, SIGBUS, etc. should be masked.

@dgageot
Copy link
Contributor Author

dgageot commented Nov 8, 2018

@briandealwis This should be better now. I realized we just have to test for the context's error and see if it was cancelled.

@@ -465,6 +465,12 @@ func DependenciesForArtifact(ctx context.Context, a *latest.Artifact) ([]string,
}

if err != nil {
// if the context was cancelled act as if all is well
// TODO(dgageot): this should be even higher in the call chain.
if ctx.Err() == context.Canceled {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will mask all errors. Perhaps you could log the error at a DEBUG level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the idea is to not show annoying errors when the user presses ctrl-c. No matter what the error is

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I suggested DEBUG :-) Just in case those errors are due to something other than SIGTERM/KILL. Anyways, it's not a blocked from me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to add debug logs

Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dgageot dgageot merged commit b645a36 into GoogleContainerTools:master Nov 8, 2018
@dgageot dgageot deleted the fix-1247 branch December 28, 2018 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants