-
Notifications
You must be signed in to change notification settings - Fork 18
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
Improve logging when operator failed before generating artifact #1252
Conversation
@@ -222,11 +221,18 @@ func (a *ArtifactImpl) updateArtifactResultAfterComputation( | |||
) | |||
if err != nil { | |||
log.Errorf("Unable to read artifact result metadata from storage and unmarshal: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, is this error ever expected in any cases? If it's a really fatal error we should probably also add a Tip to the execution state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And make it a system error or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue is often triggered by the upstream op failed without creating the metadata file. I don't really want to update the exec status here since in most cases the artifact should be canceled, and caller decides. The main goal here is to prevent this from returning an err object to caller which often gives us the false signal on real failure (the op failure). So I think logging it in the context for now is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add a comment here
return | ||
execState.Error.Context = fmt.Sprintf( | ||
"%s\nError reading metadata: %v", | ||
execState.Error.Context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is execState.Error != nil
in this case? I worry this will panic if there wasn't an issue with the computation, but something bad happened when we ReadFromStorage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's a good catch, we should check the pointer state before assigning values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, very clean!
Describe your changes and why you are making these changes
This PR improves logging when a operator failed without generating artifact metadata. The current situation being:
As the improvements, we modifies the logging with minimum change on current life-cycle management behavior:
Related issue number (if any)
ENG-2815
Testings
We are not expecting to change any life-cycle management behavior. I'd consider it as success as long as all integration tests passed
Checklist before requesting a review
python3 scripts/run_linters.py -h
for usage).run_integration_test
: Runs integration testsskip_integration_test
: Skips integration tests (Should be used when changes are ONLY documentation/UI)