Skip to content
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

jobs/build: don't try to complete ongoing builds #822

Merged
merged 2 commits into from
Feb 27, 2023

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Feb 23, 2023

Since 973bcf9 ("jobs/build: rerun build-arch if previous build is
incomplete"), there is a race possible where the build job rerun logic
could kick in before the release jobs initially triggered for that
build has finished. We don't want to queue builds in that case.

Gate the rerun logic on whether the multi-arch locks and release lock
are taken.

It's theoretically possible but highly unlikely that we probe the lock
status before the previous release job takes it. Ideally, we would
have a way to directly take the lock and "transfer" its ownership to the
job we trigger. Anyway, if that somehow happens, it would result in the
job being run twice, which is safe.

We only actually run the jobs when `uploading` is set. So it seems wrong
to update the build description. In fact, let's not even waste time
looking for missing arches or reading build metadata.

Patch best viewed with whitespace ignored.
@dustymabe
Copy link
Member

alternative in #823

jobs/build.Jenkinsfile Outdated Show resolved Hide resolved
@jlebon jlebon force-pushed the pr/build-race branch 2 times, most recently from e011c4d to ce91c98 Compare February 27, 2023 17:29
jobs/build.Jenkinsfile Outdated Show resolved Hide resolved
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Since 973bcf9 ("jobs/build: rerun `build-arch` if previous build is
incomplete"), there is a race possible where the `build` job rerun logic
could kick in before the `release` jobs initially triggered for that
build has finished. We don't want to queue builds in that case.

Gate the rerun logic on whether the multi-arch locks and release lock
are taken.

It's theoretically possible but highly unlikely that we probe the lock
status before the previous `release` job takes it. Ideally, we would
have a way to directly take the lock and "transfer" its ownership to the
job we trigger. Anyway, if that somehow happens, it would result in the
job being run twice, which is safe.
@dustymabe dustymabe merged commit fcea566 into coreos:main Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants