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

Fixes #15755 - handle race condition on pool import #6196

Merged
merged 1 commit into from Jul 20, 2016

Conversation

jlsherrill
Copy link
Member

No description provided.

pool = ::Katello::Pool.where(:cp_id => pool_json['id']).first_or_create
pool.import_data
end
pools.each { |pool_json| ::Katello::Pool.import_pool(pool_json['id']) }
Copy link
Member

Choose a reason for hiding this comment

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

Is it no longer necessary to 'import_data' at this point?

Copy link
Member Author

Choose a reason for hiding this comment

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

it is, notice i'm calling Pool.import_pool which handles the creation and import_data. The code was duplicated here so i was DRYing it out a bit.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@bbuckingham
Copy link
Member

The code changes look good.

I was not able to reproduce the race condition that this is intended to solve; however, I was able to confirm that I can still create products and repositories as expected.

ACK; however, feel free to wait on merging if those that were encountering the race condition are in the process of testing as well.

@ehelms
Copy link
Member

ehelms commented Jul 20, 2016

[test]

@jlsherrill jlsherrill merged commit 0438357 into Katello:master Jul 20, 2016
@jlsherrill jlsherrill deleted the 15755 branch July 20, 2016 19:43
jlsherrill added a commit to jlsherrill/katello that referenced this pull request Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants