Skip to content

Commit

Permalink
Add more debug messages for watcher creation
Browse files Browse the repository at this point in the history
This helps debug why sometimes a watcher is not created.

Signed-off-by: Vincent Liu <[email protected]>
  • Loading branch information
Vincent-lau committed Sep 3, 2024
1 parent 53a8b49 commit 24b4626
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ocaml/xapi/xapi_clustering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ module Watcher = struct
There is no need to destroy them: once the clustering daemon is disabled,
these threads will exit as well. *)
let create_as_necessary ~__context ~host =
if Helpers.is_pool_master ~__context ~host && Daemon.is_enabled () then (
let is_master = Helpers.is_pool_master ~__context ~host in
let daemon_enabled = Daemon.is_enabled () in
if is_master && daemon_enabled then (
if Xapi_cluster_helpers.cluster_health_enabled ~__context then
if Atomic.compare_and_set cluster_change_watcher false true then (
debug "%s: create watcher for corosync-notifyd on coordinator"
Expand Down Expand Up @@ -703,5 +705,9 @@ module Watcher = struct
) else
debug "%s: not create watcher for cluster stack as it already exists"
__FUNCTION__
)
) else
debug
"%s not create watcher because we are %b master and clustering is \
enabled %b "
__FUNCTION__ is_master daemon_enabled
end

0 comments on commit 24b4626

Please sign in to comment.