-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 PipelineRun reconciler panic for computed timeouts #6886
Conversation
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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.
Thanks for the patch. lgtm!
@@ -636,7 +638,7 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1.PipelineRun, getPipel | |||
} | |||
} | |||
if tasksToTimeOut.Len() > 0 { | |||
logger.Infof("PipelineRun tasks timeout of %s reached, cancelling tasks", pr.Spec.Timeouts.Tasks.Duration.String()) | |||
logger.Infof("PipelineRun tasks timeout of %s reached, cancelling tasks", tasksTimeout) |
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.
NIT: If taskTimeout
is nil, this will not panic but the message won't be very helpful. Also, I wonder if we really need to log at Info
level every time a timeout fires. That's also something we can fix in a separate PR though.
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.
Changed log level to debug! I think if tasksTimeout
is nil, that would signify a bug in our implementation- not sure what the best way to handle that would be?
Prior to this commit, log lines in the pipelinerun reconciler assumed that if a pipelineRun had reached its tasks timeout, `spec.timeouts.tasks` was set, rather than computed from `spec.timeouts.pipeline` and `spec.timeouts.finally`, and likewise for the finally timeout. This commit updates log messages to avoid the controller panic, and adds tests for this fix.
232b4ee
to
e256fc0
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/cherry-pick release-v0.47.x |
@afrittoli: once the present PR merges, I will cherry-pick it on top of release-v0.47.x in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-v0.44.x |
@afrittoli: once the present PR merges, I will cherry-pick it on top of release-v0.44.x in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@afrittoli would you mind taking another look at this PR? |
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.
/lgtm
thanks @lbernick
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@afrittoli: #6886 failed to apply on top of branch "release-v0.47.x":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@afrittoli: #6886 failed to apply on top of branch "release-v0.44.x":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@lbernick @afrittoli this didn't get cherry-picked to the previous LTS branches.. Did we cherry-pick manually or is it something we still need to do ? |
Oh, good catch @vdemeester, I did not cherry pick it, so unless someone else did it, it needs to be done |
Prior to this commit, log lines in the pipelinerun reconciler assumed that if a pipelineRun had reached its tasks timeout,
spec.timeouts.tasks
was set, rather than computed fromspec.timeouts.pipeline
andspec.timeouts.finally
, and likewise for the finally timeout.This commit updates log messages to avoid the controller panic, and adds tests for this fix.
/kind bug
closes #6885
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes