HomeClusterLabs Projects

Refactor: fencer: use pcmk__schedule_actions() properly

Description

Refactor: fencer: use pcmk__schedule_actions() properly

The fencer's cib_devices_update() doesn't need to assert that fenced_data_set
is not NULL because main() already did that before starting the main loop.

The function previously set fenced_data_set->now to crm_time_new(NULL)
unconditionally, meaning that any previous value would be leaked. Now, free and
NULL ->now before calling pcmk__schedule_actions(), which will set it to
crm_time_new(NULL) on its own.

It also previously set fenced_data_set->input to local_cib directly, and passed
NULL as the cib to pcmkschedule_actions(), which would normally assert on
that condition, so it also called cluster_status() redundantly before calling
pcmk
schedule_actions(), which would avoid the assertion. Now, just pass
local_cib to pcmk__schedule_actions() and don't call cluster_status().

Details

Provenance
kgaillotAuthored on Jan 25 2022, 2:13 PM
Parents
rPf0fe7a396c21: Refactor: scheduler: allocate and free data set every request
Branches
Unknown
Tags
Unknown

Event Timeline