Add retries and fallback to actual API calls to status updates.#6162
Conversation
knative-prow-robot
left a comment
There was a problem hiding this comment.
@markusthoemmes: 0 warnings.
Details
In response to this:
Proposed Changes
See title.
Release Note
Reduced update conflicts.
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.
|
if we're reconciling an 'out of date' object should we be updating the status of the latest version of the object? |
|
@dprotaso I thought along the same lines, this is mostly asking Dr. Empirical if this does anything. It indeed cuts down the conflicts from ~300 to I'll work on adding more debugging next week to try to find out if there's a pattern of what gets in the way here, especially as this seems to be particularly bad downstream on Openshift. |
|
@dprotaso I think it's fine so long at the |
|
So should we at this point compare generation as well, since it might have changed? |
|
Poking at some K8s controllers it seems like they attempt to update the status and if it fails they fetch and retry one time (jobs controller retries 3 times 🤷♀ ) |
|
@vagababov the point is that if the generation changes, that's fine. The status we are posting is only stating that we've reconciled a previous generation. @dprotaso I assume the fetch is via the client? |
yup |
|
Well makes sense, since it's double-checking-lock pattern in essence :) |
1b5ab78 to
fdf8519
Compare
|
At the latest state, this PR now produces significantly less churn |
|
/test pull-knative-serving-go-coverage |
| existing := pa.DeepCopy() | ||
| existing.Status = desired.Status | ||
| func (c *Base) UpdateStatus(desired *pav1alpha1.PodAutoscaler) error { | ||
| return reconciler.RetryUpdateConflicts(func(i int) error { |
There was a problem hiding this comment.
can i be something more descriptive like attempt
| } | ||
|
|
||
| // If there's nothing to update, just return. | ||
| if reflect.DeepEqual(existing.Status, desired.Status) { |
There was a problem hiding this comment.
I realize this wasn't in the prior code - feel free to leave this as a separate PR or I can do it
There was a problem hiding this comment.
Yeah, let's leave it separate. Was wondering the same while doing it though.
There was a problem hiding this comment.
As mentioned, won't fix in this PR. I don't want to inadvertedly and subtly break things in this PR which is already kinda invasive. Let's make that a separate change please.
| return nil | ||
| } | ||
|
|
||
| becomesReady := desired.Status.IsReady() && !existing.Status.IsReady() |
There was a problem hiding this comment.
This makes me wonder - what's causing the conflicts? (ie. is it the labeller or gc'er)
|
The following is the coverage report on the affected files.
|
|
The following jobs failed:
Automatically retrying due to test flakiness... |
|
/test pull-knative-serving-unit-tests |
|
Values from the last run Configurations failures are all from the labeler. I'd like to attack that in a separate PR though to keep this only about status updates. |
|
Should we move the pkg/reconciler stuff into knative.dev/pkg/reconciler? I can do that in a follow up, but since we're doing this in all the repos, seems like it could / should be hoisted? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, markusthoemmes The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
removing the hold label since everybody that participated has lgtm'd it. |
|
/test pull-knative-serving-upgrade-tests |
|
/test pull-knative-serving-upgrade-tests |
Did this in knative/pkg#1008 (as part of google/knative-gcp#508). Also created #6657 to use the retry.go from knative.dev/pkg/reconciler and add more tests.
I'm planning on taking on doing this change in |
Created knative/eventing#2465 for knative/eventing |
Proposed Changes
See title.
Release Note