-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
squash! Check that a promotion isn't invoked repeatedly
- use helpers to start and complete promotions - use a predicate to prevent queueing updates unless the spec chnaged On the second one: there's a race between the cache getting an object with the promotion status, and the reconciler processing the object again. It's possible for the reconciler, having just triggered a promotion, to run again and see a version of the pipeline object that doesn't have the promotion recorded -- and that will mean attempting the promotion again. In testing, this happens almost always, because patches will cause the object to be requeued before it's finished reconciling, and it'll run again as soon as its exited. I would expect it to also be common in normal operation; and the outcome is that a promotion is re-run, which is not great! To mitigate the race, I've added a predicate to the watch which will drop updates that didn't change the spec. This means that the patches earlier in Reconcile won't cause the object to be requeued, and it is much, much less likely that it'll run again straight away. It's still possible -- maybe the spec changed while it was running. Other, more involved ways to avoid it: - use conflict detection on write to bail before running a promotion, if the observed pipeline has changed - create Promotion objects and guard promotions by trying to create (another form of detecting conflict on write)
- Loading branch information
Showing
2 changed files
with
35 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters