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

Seeding timeout #15595

Merged
merged 1 commit into from
Aug 1, 2017
Merged

Seeding timeout #15595

merged 1 commit into from
Aug 1, 2017

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Jul 18, 2017

Before

Since seeding can only be performed on one system at a time, we set a timeout to limit our blocking of systems.

The initial seeding over a WAN can take longer than our timeout of 10 minutes.
So the initial seeding times out, the database never gets populated, and the app will never run.

Solution:

Add a variable to temporarily increase the seeding timeout.
This will give the app enough time for the initial seeding of the database.

Since subsequent seeding is quicker, this option (env variable) only needs to be used for the first boot of the application.

In addition, a more descriptive error message has been to the log.

https://bugzilla.redhat.com/show_bug.cgi?id=1422671

To test, I ran:

SEEDING_LOCK_TIMEOUT=1 bundle exec rails db:seed

/cc @Fryguy No idea why the other PR closed.

@@ -63,10 +63,10 @@ def self.seed(classes = nil, exclude_list = [])
classes ||= PRIMORDIAL_CLASSES + (seedable_model_class_names - PRIMORDIAL_CLASSES)
classes -= exclude_list

lock_timeout = ENV["SEEDING_LOCK_TIMEOUT"].to_i # default: 600
lock_timeout = 10.minutes if lock_timeout.zero?
Copy link
Member

Choose a reason for hiding this comment

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

Maybe lock_timeout = ENV["SEEDING_LOCK_TIMEOUT"] || 10.minutes
Is there any other time that this is zero?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was there to handle a nil or a ""

Will add the to_i and consolidate to one line.

Seeding over a WAN can take longer than 10 minutes.
This allows the timeout to be increased temporarily.

https://bugzilla.redhat.com/show_bug.cgi?id=1422671
@miq-bot
Copy link
Member

miq-bot commented Aug 1, 2017

Checked commit kbrock@d082c47 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@bdunne bdunne merged commit bb868cc into ManageIQ:master Aug 1, 2017
@bdunne bdunne added this to the Sprint 66 Ending Aug 7, 2017 milestone Aug 1, 2017
@kbrock kbrock deleted the seeding_timeout branch August 3, 2017 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants