Skip to content

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

Closed

Conversation

lindig
Copy link
Contributor

@lindig lindig commented Mar 19, 2025

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.

Christian Lindig added 2 commits March 19, 2025 09:59
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>
@lindig lindig requested a review from robhoes March 19, 2025 14:15
@@ -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 () ;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Member

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...

Copy link
Contributor Author

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.

@lindig
Copy link
Contributor Author

lindig commented Mar 25, 2025

@robhoes Reject this?

@robhoes
Copy link
Member

robhoes commented Mar 25, 2025

@lindig, depends how important the use case is, but I'd rather not take it.

@lindig
Copy link
Contributor Author

lindig commented Mar 26, 2025

Let's not do this for now.

@lindig lindig closed this Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants