Skip to content

Commit

Permalink
fixup! CA-395789: Add polling to cluster health state update
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-lau committed Jul 22, 2024
1 parent a2d9601 commit 733afff
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ocaml/xapi/xapi_clustering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ module Watcher = struct

(* This is the time it takes for the update request to time out. It is ok to set
it to a relatively long value since the call will return immediately if there
is an update. Here we wait for 5 minutes *)
let cluster_change_interval = Clock.Timer.s_to_span 300. |> Option.get
is an update. *)
let cluster_change_interval = Mtime.Span.(5 * min)

let cluster_stack_watcher : bool Atomic.t = Atomic.make false

Expand All @@ -563,12 +563,13 @@ module Watcher = struct
()
)
| Error (InternalError "UPDATES.Timeout") -> (
(* CA-395789: UPDATES.get timed out, this is normal. We send a query to
xapi-clusterd to fetch the latest state anyway in case there is a race
and the previous update did not give the most up-to-date information *)
(* UPDATES.get timed out, this is normal. *)
match find_cluster_host ~__context ~host with
| Some ch ->
let cluster = Db.Cluster_host.get_cluster ~__context ~self:ch in
(* CA-395789: We send a query to xapi-clusterd to fetch the latest state
anyway in case there is a race and the previous update did not give the
most up-to-date information *)
on_corosync_update ~__context ~cluster ["routine updates"]
| None ->
()
Expand Down

0 comments on commit 733afff

Please sign in to comment.