-
Notifications
You must be signed in to change notification settings - Fork 916
Fix workers not restarting when auth/endpoints are changed. #22269
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
base: master
Are you sure you want to change the base?
Fix workers not restarting when auth/endpoints are changed. #22269
Conversation
1ee330a to
0733f89
Compare
| endpoints_changed = false | ||
| authentications_changed = false |
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.
NOTE I'm not sure how necessary it is to differentiate between endpoints and authentications changing. Currently as far as I can tell we only use this information to restart workers and we need to do that when either endpoints or authentications change.
0733f89 to
eb74c6c
Compare
| end | ||
|
|
||
| def stop_event_monitor_queue_on_credential_change | ||
| if event_monitor_class && !self.new_record? && self.credentials_changed? |
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.
NOTE credentials_changed? used an instance variable set early in #update_authentications but it seemed easier to just check default_authentication.changed?
I didn't want to rewrite the credentials_changed? method to use this in case something else depended on that exact behavior.
Also that method only checked auth_user_pwd which wouldn't work for k8s/gce/etc... which use an auth_key.
I would like to be able to specify e.g. authentication_for_events rather than default_authentication in case a provider doesn't use the default_auth for events.
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.
Is that something you want to do as a followup or for this PR?
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 should be able to get that working in this PR
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've added authtype_for_event/refresh and endpoint_role_for_event/refresh so that the callbacks can check the changes for endpoints they care about
|
Example changing the credentials for an Openshift provider |
0015fd8 to
d42f66f
Compare
From Pull Request: ManageIQ/manageiq#22269
1ed4d61 to
0394dd3
Compare
From Pull Request: ManageIQ/manageiq#22269
|
Note that there's a WIP commit message in here, that should be cleaned up when this is ready. |
0394dd3 to
1215980
Compare
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
b9d480e to
2ebfd61
Compare
|
@agrare Is this ready to go? Maybe a cross-repo test? |
When changes are made to the endpoints or authentications workers which run with an open connection like event catchers and streaming refresh workers have to be restarted. This was done via `after_update_authentication` called from `update_authentication`. The issue is that this method is no longer called when providers are updated via the API with DDF parameters.
2ebfd61 to
6f5a865
Compare
|
Checked commits agrare/manageiq@2c4ff02~...6f5a865 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
|
ok, ManageIQ/manageiq-cross_repo-tests#720 is green. Does this mean we are ready to go? |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request is not mergeable. Please rebase and repush. |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
4 similar comments
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
When changes are made to the endpoints or authentications workers which run with an open connection like event catchers and streaming refresh workers have to be restarted.
This was done via
after_update_authenticationcalled fromupdate_authentication. The issue is that this method is no longer called when providers are updated via the API with DDF parameters.We also have some
before_save :stop_event_monitor_queue_on_change, :stop_refresh_worker_queue_on_changebut these aren't invoked because auth/endpoint changes aren't part of theext_management_systemrecord.Ref ManageIQ/manageiq-providers-openshift#235 (comment)
TODO
Depends on:
Cross-Repo: ManageIQ/manageiq-cross_repo-tests#720