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 #15114 - initialize Katello plugin sooner #6059

Merged
merged 1 commit into from May 24, 2016

Conversation

iNecas
Copy link
Member

@iNecas iNecas commented May 20, 2016

Initializing the Katello plugin too late causes issues when resuming Dynflow
tasks (for example the loggers not being initialized)

Foreman recommends before :finisher_hook as alternative hook to be used

https://github.com/theforeman/foreman/blob/1.11.0/config/initializers/assets_paths.rb#L17

Blocks theforeman/foreman-tasks#185

@iNecas
Copy link
Member Author

iNecas commented May 20, 2016

Dear @theforeman-bot, it's nice you prefer short lines but I really think it's good idea to give some external links to clarify the patch and it's not a good idea to wrap the links to fit the 72 chars limit

@adamruzicka
Copy link
Member

Works as expected, didn't encounter any issues when testing it with theforeman/foreman-tasks#185

@ehelms
Copy link
Member

ehelms commented May 23, 2016

If you look at the failure from the assets precompile test, you will see why we had to make the change this is reverting:

http://ci.theforeman.org/job/test_katello_assets_precompile/3069/ruby=2.2/consoleFull

@theforeman-bot
Copy link

There were the following issues with the commit message:

  • commit message for acbf915602f7d048a86e134410079ee94f4d2d8f is not wrapped at 72nd column

If you don't have a ticket number, please create an issue in Redmine, selecting the appropriate project.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@iNecas
Copy link
Member Author

iNecas commented May 23, 2016

@ehelms funny thing there was also an issue when the initializer was too low int he engine file. I've put it up a bit and things seemed to start working in the rake task as well.

@ehelms
Copy link
Member

ehelms commented May 23, 2016

@iNecas starting to think we need a more robust, predictable system for loading up our plugins :)

@iNecas
Copy link
Member Author

iNecas commented May 23, 2016

@ehelms :) Anyway, it's all green now and works properly with foreman-tasks now.

@ehelms
Copy link
Member

ehelms commented May 23, 2016

I'm not usually a fan of comments, however, I think in this instance a comment here about why that needs to be where it is would be quite useful

@theforeman-bot
Copy link

There were the following issues with the commit message:

  • commit message for 469d6b106e0f686bd7e64095cbc99b8752b2bcee is not wrapped at 72nd column

If you don't have a ticket number, please create an issue in Redmine, selecting the appropriate project.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@iNecas
Copy link
Member Author

iNecas commented May 23, 2016

@ehelms +1 something like this?

@@ -87,6 +87,13 @@ def find_assets(args = {})
require 'katello/apipie/validators'
end

# make sure the Katello plugin is initialized before `after_initialize`
# hook so that the resumed Dynflow tasks can rely on everything ready.
initializer 'katello.register_plugin', :before => :finisher_hook do
Copy link
Member

Choose a reason for hiding this comment

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

One more thought, we need this to run before foreman_tasks.initialize_dynflow initializer is run? If so, this might could be done more explicitly via:

initializer 'katello.register_plugin', :before => 'foreman_tasks.initialize_dynflow'

Copy link
Member Author

Choose a reason for hiding this comment

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

In fact, in theforeman/foreman-tasks#185, the initialization of dynflow runtime was moved to after_initialize - not the dynflow configuration, that can be performed in any initializer block as before, so I've replaced the occurrences of :before => 'foreman_tasks.initialize_dynflow' with :before => :finisher_hook.

Initializing the Katello plugin too late causes issues when resuming
Dynflow tasks (for example the loggers not being initialized)

Foreman recommends before :finisher_hook as alternative hook to be used

https://github.com/theforeman/foreman/blob/1.11.0/config/initializers/assets_paths.rb#L17

Blocks theforeman/foreman-tasks#185
@theforeman-bot
Copy link

There were the following issues with the commit message:

  • commit message for bfcef57 is not wrapped at 72nd column

If you don't have a ticket number, please create an issue in Redmine, selecting the appropriate project.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@@ -105,7 +112,7 @@ def find_assets(args = {})
end
end

initializer "katello.initialize_cp_listener", after: "foreman_tasks.initialize_dynflow" do
Copy link
Member Author

Choose a reason for hiding this comment

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

The :after => "foreman_tasks.initialize_dynflow" condition was not needed with recent foreman_tasks changes and on_init block.

@ehelms
Copy link
Member

ehelms commented May 24, 2016

Thanks @iNecas for indulging all my questions! ACK

@ehelms ehelms merged commit 28cb3ef into Katello:master May 24, 2016
@stbenjam
Copy link
Contributor

@iNecas This seems to affect rake db:migrate in production. With this change foreman-tasks shows down for our backend services checks. If I revert engine.rb to the previous version, it all works fine again. I filed http://projects.theforeman.org/issues/15220 for the issue

Any ideas why this might be happening?

@stbenjam stbenjam mentioned this pull request May 27, 2016
ehelms pushed a commit to ehelms/katello that referenced this pull request May 27, 2016
Initializing the Katello plugin too late causes issues when resuming
Dynflow tasks (for example the loggers not being initialized)

Foreman recommends before :finisher_hook as alternative hook to be used

https://github.com/theforeman/foreman/blob/1.11.0/config/initializers/assets_paths.rb#L17

Blocks theforeman/foreman-tasks#185
(cherry picked from commit 28cb3ef)
ehelms added a commit that referenced this pull request May 29, 2016
@iNecas
Copy link
Member Author

iNecas commented May 31, 2016

I've updated dependency on newer foreman-tasks as I forgot to do that initially, sry about the confusion #6088

iNecas added a commit to iNecas/katello that referenced this pull request Jun 21, 2016
Initializing the Katello plugin too late causes issues when resuming
Dynflow tasks (for example the loggers not being initialized)

Foreman recommends before :finisher_hook as alternative hook to be used

https://github.com/theforeman/foreman/blob/1.11.0/config/initializers/assets_paths.rb#L17

Blocks theforeman/foreman-tasks#185
(cherry picked from commit 28cb3ef)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants