Skip to content
Merged
Changes from 1 commit
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
Next Next commit
CA-354414 perform best effort Pool.eject cleanups
This fixes parallel Pool.ejects - if we try to eject host B, but host C
is not contactable, we do not want to block the eject.

The price we pay for parallel ejects is that we might not clean up host
B's certificates on host C.

Signed-off-by: Ben Anson <[email protected]>
  • Loading branch information
Ben Anson committed Jun 21, 2021
commit dec54ea4a1f03e60d4db3017ce482349d22f8553
16 changes: 12 additions & 4 deletions ocaml/xapi/message_forwarding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -782,12 +782,20 @@ functor
do_op_on ~local_fn ~__context ~host (fun session_id rpc ->
Client.Pool.eject rpc session_id host
) ;
(* call eject on all other slaves first *)
(* perform cleanup on remaining pool members
* this must be best effort - once an eject has begun we cannot rollback *)
other
|> List.iter (fun h ->
do_op_on ~local_fn ~__context ~host:h (fun session_id rpc ->
Client.Pool.eject rpc session_id host
)
try
do_op_on ~local_fn ~__context ~host:h (fun session_id rpc ->
Client.Pool.eject rpc session_id host
)
with e ->
D.warn
"Pool.eject: while ejecting host=%s, we failed to clean up \
on host=%s. ignoring error: %s"
(Ref.short_string_of host) (Ref.short_string_of h)
(Printexc.to_string e)
) ;
(* finally clean up on master *)
do_op_on ~local_fn ~__context ~host:master (fun session_id rpc ->
Expand Down