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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ocaml/xapi/xapi_fuse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Thread.delay !Constants.fuse_time ;
(* this activates firstboot script and reboots the host *)
ignore
Expand Down
3 changes: 3 additions & 0 deletions ocaml/xapi/xapi_mgmt_iface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module Server : sig
val current_mode : unit -> listening_mode

val is_ipv6_enabled : unit -> bool

val stop : unit -> unit
(** Stop server for external API calls *)
end = struct
(* Keep track of the management interface server thread.
Stores a key into the table in Http_srv which identifies the server thread bound
Expand Down
5 changes: 5 additions & 0 deletions ocaml/xapi/xapi_mgmt_iface.mli
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
* @group Networking
*)

module Server : sig
val stop : unit -> unit
(** Stop server for external API calls *)
end

val himn_addr : unit -> string option
(** Local IP address of the HIMN (if any) *)

Expand Down
Loading