Closed dippynark closed 10 months ago
Hi @dippynark. Thanks for your PR.
I'm waiting for a jenkins-x member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
/ok-to-test
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: msvticket
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Failed to merge this PR due to:
failed merging [1591]: [Method Not Allowed]
We are using Lighthouse foghorn v1.14.4 and very occasionally it is getting into a continuous loop trying to update a LighthouseJob when there is a conflict.
Initially there is a failure with the following message:
It does try again and succeeds:
took 2 attempts to update Job
However, I think this is false positive because
jobCopy
(instead of&job
) is being passed intoretryModifyJob
so on retryr.client.Get
is overwritingjobCopy
and reverting the updated status, meaning the retry is just updating the LighthouseJob to its current value.This PR instead passes
&job
intoretryModifyJob
which matches with the Tekton controller: https://github.com/jenkins-x/lighthouse/blob/867b0b5c900ce2f500307e3de9bf1057972077e0/pkg/engines/tekton/controller.go#L146I don't fully understand why foghorn is getting into a continuous loop, I would have thought the update just wouldn't happen (perhaps the noop update is actually triggering another event and foghorn is continuously conflicting with itself), but either way this should fix the problem because on next reconciliation we shouldn't get past the
reflect.DeepEqual
check.For a future improvement, Lighthouse foghorn and other controllers could instead use RetryOnConflict from client-go to handle conflicts instead of the custom
retryModifyJob
function: https://pkg.go.dev/k8s.io/client-go/util/retry#RetryOnConflict