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

Ensure that command result should be reported even when the handling context's deadline passes #2292

Merged
merged 1 commit into from Jul 26, 2021

Conversation

nghialv
Copy link
Member

@nghialv nghialv commented Jul 26, 2021

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@@ -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 {
Copy link
Member Author

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.

Copy link
Member

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 👍

@nakabonne
Copy link
Member

/lgtm

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.81%. This pull request increases coverage by 0.01%.

File Function Base Head Diff
pkg/app/piped/planpreview/handler.go Handler.Run 95.00% 94.74% -0.26%
pkg/app/piped/planpreview/handler.go Handler.handleCommand 45.45% 48.57% +3.12%

@khanhtc1202
Copy link
Member

🚀
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit 992ceca into master Jul 26, 2021
@pipecd-bot pipecd-bot deleted the planpreview branch July 26, 2021 06:54
@nghialv
Copy link
Member Author

nghialv commented Jul 26, 2021

/changelog

@pipecd-bot
Copy link
Collaborator

CHANGELOG

@nghialv: Changelog has been generated in response to this comment.

Details

Changelog since v0.13.0

Notable Changes

  • Fix panic error log that occasionally occurs while running plan preview tasks (#2290)

Internal Changes

  • Ensure that command result should be reported even when the handling context's deadline passes (#2292)
  • Finish up Grafana Cluster dashboards (#2286)
  • Add missing Piped copyright (#2288)
  • Update piped Grafana dashboard reflects name changed (#2284)
  • Filter outdated piped stat metrics (#2281)
  • Fix broken layout of error block on plan-preview comment (#2282)
  • Expose pipecd ops metrics (#2279)
  • Add missing close redis connection in ops (#2280)
  • Fix wrong way to check unmergeable pull request (#2278)
  • Bump actions-plan-preview image to use pipectl v0.13.0 (#2277)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants