-
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
Avoid occasional failures when using remote resolution #6424
Avoid occasional failures when using remote resolution #6424
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/kind bug |
/assign |
/assign |
bccf89e
to
b457654
Compare
/ok-to-test |
b457654
to
4edb527
Compare
/hold I need to check my account settings before the final merge. |
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 @l-qing! Could you please also add an unit test for it?
@@ -54,7 +55,10 @@ var _ Requester = &CRDRequester{} | |||
func (r *CRDRequester) Submit(ctx context.Context, resolver ResolverName, req Request) (ResolvedResource, error) { | |||
rr, _ := r.lister.ResolutionRequests(req.Namespace()).Get(req.Name()) | |||
if rr == nil { | |||
if err := r.createResolutionRequest(ctx, resolver, req); err != nil { | |||
if err := r.createResolutionRequest(ctx, resolver, req); err != nil && | |||
// If the request already exists then we can assume that is in progress. |
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.
can we add the reason why it may already exist in the comment? I personally didn't get the idea until reading the commit message 😄
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.
Ok, I add a simple description.
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!
/remove-hold |
4edb527
to
5060886
Compare
Can I create a separate pull request to add this unit test? Previously, there were no unit tests in this package. This feature relies on some interfaces. My computer needs to be repaired this weekend, so I may not have time to work on it, but I should have time next weekend. 😁 |
Thank you for the fix @l-qing! I have a few questions:
I agree with @QuanZhang-William we should have unit tests for this but I see your point that this package is not really tested at all; I've created #6429 to track testing. Can you please reword the release note to mention changes visible to users? Users don't typically interact with ResolutionRequests (or shouldn't have to); they mainly interact with TaskRuns/PipelineRuns using remote resolution |
fix tektoncd#6408 When the time interval between two reconciliations of the owner (TaskRun, PipelineRun) of a ResolutionRequest is short, it may cause the second reconciliation to fail when triggering a Submit because the informer cache may not have been updated yet. In this case, we can assume that it is in progress, and the next reconciliation will handle it based on the actual situation.
5060886
to
c5c2a0f
Compare
Hi, @lbernick I have revised my comments and release note based on your suggestions. Replying to your questions: 1. "submitting resolution requests quickly"I mean the same request reconciles frequently, such as TaskRun/PipelineRun. Call chain: pipeline/pkg/reconciler/taskrun/taskrun.go Lines 328 to 339 in 40763d8
pipeline/pkg/reconciler/taskrun/resources/taskref.go Lines 165 to 172 in 40763d8
pipeline/pkg/remote/resolution/resolver.go Lines 58 to 65 in 40763d8
pipeline/pkg/resolution/resource/crd_resource.go Lines 51 to 57 in 40763d8
2. "What cache are you referring to here?"I mean the informer cache. pipeline/pkg/client/resolution/informers/externalversions/resolution/v1alpha1/resolutionrequest.go Lines 80 to 90 in 40763d8
3. "Do you have a sense of why duplicate ResolutionRequests are being created?"This is bound to happen as long as a TaskRun that uses remote tasks reconciles quickly twice in its initial creation phase. 4. "how you know that this fix resolved it?"Previously, this occurred very frequently in my environment. About 8 out of 10 times, it would fail due to this issue. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lbernick, QuanZhang-William 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 |
Thank you for the detailed explanation, and for assigning yourself to the issue I created! |
@chitrangpatel Hi, could you please review again and give an LGTM label? |
/lgtm |
@chitrangpatel Thank you! |
fix #6408
When the time interval between two reconciliations of the
owner (TaskRun, PipelineRun) of a ResolutionRequest is short,
it may cause the second reconciliation to fail when triggering
a Submit because the informer cache may not have been updated yet.
In this case, we can assume that it is in progress, and the next
reconciliation will handle it based on the actual situation.
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes