diff options
author | James E. Blair <jim@acmegating.com> | 2022-07-21 14:05:57 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2022-07-25 13:22:19 -0700 |
commit | a9a9d32b210f3fa7dee8d12bbd2748e152207ea6 (patch) | |
tree | 47f1f3be72c0e20374f085584f91b4556bdbf5e9 /zuul | |
parent | 4a4a33720b1bca9f454e6f29d89c0865548503d7 (diff) | |
download | zuul-a9a9d32b210f3fa7dee8d12bbd2748e152207ea6.tar.gz |
Fix duplicate setResult calls in deduplicated builds
We call item.setResult after a build is complete so that the queue
item can do any internal processing necessary (for example, prepare
data structures for child jobs, or move the build to the retry_builds
list).
In the case of deduplicated builds, we should do that for every queue
item the build participates in since each item may have a different
job graph.
We were not correctly identifying other builds of deduplicated jobs
and so in the case of a dependency cycle we would call setResult on
jobs of the same name in that cycle regardless of whether they were
deduplicated.
This corrects the issue and adds a test to detect that case.
Change-Id: I4c47beb2709a77c21c11c97f1d1a8f743d4bf5eb
Diffstat (limited to 'zuul')
-rw-r--r-- | zuul/manager/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/zuul/manager/__init__.py b/zuul/manager/__init__.py index 642aededd..417de9acd 100644 --- a/zuul/manager/__init__.py +++ b/zuul/manager/__init__.py @@ -1768,9 +1768,12 @@ class PipelineManager(metaclass=ABCMeta): build_in_items = [item] if item.bundle: for other_item in item.bundle.items: - if other_item not in build_in_items: - if other_item.current_build_set.getBuild(build.job.name): - build_in_items.append(other_item) + if other_item in build_in_items: + continue + other_build = other_item.current_build_set.getBuild( + build.job.name) + if other_build is not None and other_build is build: + build_in_items.append(other_item) for item in build_in_items: # We don't care about some actions below if this build # isn't in the current buildset, so determine that before |