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
Ensure that command result should be reported even when the handling context's deadline passes #2292
Conversation
…context's deadline passes
@@ -262,6 +261,7 @@ func (h *Handler) handleCommand(ctx context.Context, cmd model.ReportableCommand | |||
if err != nil { | |||
logger.Error("failed to marshal command result", zap.Error(err)) | |||
} | |||
|
|||
if err := cmd.Report(ctx, model.CommandStatus_COMMAND_FAILED, nil, output); err != nil { |
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.
With the current code, this Report
function will not be executed when the command context's deadline passes.
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.
Ah, got it. Nice catch 👍
/lgtm |
Code coverage for golang is
|
🚀 |
/changelog |
@nghialv: Changelog has been generated in response to this comment. DetailsChangelog since v0.13.0Notable Changes
Internal Changes
|
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: