-
Notifications
You must be signed in to change notification settings - Fork 292
CA-403851 disable API of ejected pool member #6371
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
Conversation
Expose in MLI an existing function to stop the API server thread. Signed-off-by: Christian Lindig <christian.lindig@cloud.com>
This reverts commit 74aeb77. Signed-off-by: Christian Lindig <christian.lindig@cloud.com>
@@ -86,6 +86,8 @@ let light_fuse_and_reboot_after_eject () = | |||
ignore | |||
(Thread.create | |||
(fun () -> | |||
debug "%s: stop management server" __FUNCTION__ ; | |||
Xapi_mgmt_iface.Server.stop () ; |
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 see it was stopped by "Xapi_mgmt_iface.run ~__context ~mgmt_enabled:false", may I know why it can't be stopped as before?
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.
The problem was a failing SDK test that used Pool.Async.eject
. The API call could not properly communicate that it was finished before the server was shut down. I suspect the Async was the problem. Again, all of this might not be worth it - I think this is mostly a cosmetic issue.
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.
Yeah I don't really like exposing this internal function in Xapi_mgmt_iface. It leads to spaghettification of the code. And xapi is already complicated enough...
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.
Yeah, in the fuse you don't have the context available so can't use the function. I also don't like that there seem to be more scenarios where we reboot and don't disable the management interface.
@robhoes Reject this? |
@lindig, depends how important the use case is, but I'd rather not take it. |
Let's not do this for now. |
When a pool member is ejected, for a (short) time it is still seen by XenCenter as a pool member because its role only changes after a reboot. To avoid it accepting API calls, disable the API server after the pool eject call has been processed. This happens in the call that initiates the reboot because the API call for the eject needs to finish first. We can't use a function there that requires the
__context
and thus use a lower-level primitive.This might overall not be worth the effort to fix a mostly cosmetic problem, Passes the BST.