Skip to content

Commit

Permalink
Merge pull request #5389 from robhoes/cluster-health-flag
Browse files Browse the repository at this point in the history
Only start cluster watcher if cluster_health feature enabled
  • Loading branch information
robhoes committed Jan 25, 2024
2 parents 1e11e6a + c8c6625 commit 82b10ac
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions ocaml/xapi/xapi_clustering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ let on_corosync_update ~__context ~cluster updates =
__FUNCTION__ (Printexc.to_string exn)

let create_cluster_watcher_on_master ~__context ~host =
if Helpers.is_pool_master ~__context ~host then (
if Helpers.is_pool_master ~__context ~host then
let watch () =
while !Daemon.enabled do
let m =
Expand Down Expand Up @@ -515,6 +515,16 @@ let create_cluster_watcher_on_master ~__context ~host =
Thread.delay 3.
done
in
debug "%s: create watcher for corosync-notifyd on master" __FUNCTION__ ;
ignore @@ Thread.create watch ()
)
let feature_enabled =
let pool = Helpers.get_pool ~__context in
let restrictions = Db.Pool.get_restrictions ~__context ~self:pool in
List.assoc_opt "restrict_cluster_health" restrictions = Some "false"
in
if feature_enabled then (
debug "%s: create watcher for corosync-notifyd on master" __FUNCTION__ ;
ignore @@ Thread.create watch ()
) else
debug
"%s: not creating watcher for corosync-notifyd: feature cluster_health \
not enabled"
__FUNCTION__

0 comments on commit 82b10ac

Please sign in to comment.