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

Refs #37785 - Race condition during container push #11162

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented Sep 26, 2024

What are the changes introduced in this pull request?

Updates:
Refactor container push root creation into it's own action.
Acquire lock on product when saving container push root and repository.

Considerations taken when implementing this change?

Acquiring lock on product before saving root and repo makes sure only one worker can run the save! at a time even if we have multiple workers starting the create_root task at the exact same time.

What are the testing steps for this pull request?

What are the testing steps for this pull request?

Push a container image to katello.

podman pull quay.io/prometheus/busybox
podman login `hostname`
podman image list
podman push <img_id> `hostname`/default_organization/<product_label>/<container_name>

Try multiple times till you see the race condition happen. It might take a few attempts to reproduce this.
On this branch, you shouldn't see the race condition causing a container push failure. You may see a logger statement when the race condition happens and the push should proceed as normal afterwards.

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

This is working well so far, I haven't seen any related errors pop up yet. Just one organization question:

app/lib/actions/katello/repository/create_root.rb Outdated Show resolved Hide resolved
Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Working well! Tested by pushing the same container content to many new repositories.

@sjha4 sjha4 merged commit 89fdf9d into Katello:master Sep 27, 2024
27 checks passed
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