-
Notifications
You must be signed in to change notification settings - Fork 898
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
Reload the ems object in the event catcher if we fail to start #14736
Reload the ems object in the event catcher if we fail to start #14736
Conversation
When the embedded ansible role changes servers the endpoint url changes. This causes the event catcher to get http errors on the old url. Reloading the object will pick up the new url and allow the event monitor thread to start. https://bugzilla.redhat.com/show_bug.cgi?id=1439392
Checked commit carbonin@48f3479 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
return tid unless tid.nil? | ||
|
||
# Get a new copy of the ems record in case the embedded ansible role changed servers | ||
@ems.reload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I am not very familiar with the life cycle, 3 (maybe obvious to others) questions,
- Do we need to reload before the call to
super
so that whatever being done insuper
will reflect the new state in ems? - The
url
is stored in endpoint which will be reloaded as well, right? - Is this behavior applicable to other managers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Do we need to reload before the call to super so that whatever being done in super will reflect the new state in ems?
I didn't do it this way because I wanted to stay as close to the original implementation as possible which meant keeping the @ems
"cache" around and only reloading when it might be necessary. This prevents us from having to go to the database every call (although I'm not sure this method is called very frequently so maybe that doesn't matter).
- The url is stored in endpoint which will be reloaded as well, right?
It is and it definitely seems that way (I tested this out on live machines).
- Is this behavior applicable to other managers?
I don't think so because other managers don't expect the endpoint url to change, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if we need this for the refresh worker also ... we didn't see the same problem, but maybe that's just because refreshes happen less frequently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice!
…r_failure Reload the ems object in the event catcher if we fail to start (cherry picked from commit 3d18b43) https://bugzilla.redhat.com/show_bug.cgi?id=1442172
Fine backport details:
|
When the embedded ansible role changes servers the endpoint url changes. This causes the event catcher to get http errors on the old url.
Reloading the object will pick up the new url and allow the event monitor thread to start.
https://bugzilla.redhat.com/show_bug.cgi?id=1439392