Skip to content

Commit e45ed18

Browse files
committed
Refactor: controller: Clarify register_fsa_error_adv() somewhat
Signed-off-by: Reid Wahl <[email protected]>
1 parent 556a2fb commit e45ed18

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

daemons/controld/controld_messages.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,31 @@ void
3636
register_fsa_error_adv(enum crmd_fsa_input input, fsa_data_t *cur_data,
3737
ha_msg_input_t *new_data, const char *raised_from)
3838
{
39-
/* save the current actions if any */
39+
/* Save the current actions, if any. This prepends the current action set,
40+
* cause, and data object to the FSA queue to be processed next after
41+
* processing the error.
42+
*
43+
* The state transition and action fetching for this FSA input have already
44+
* been done. We pass I_NULL so that no new state transition or action
45+
* fetching will occur when this input is popped off the queue.
46+
*/
4047
if (controld_globals.fsa_actions != A_NOTHING) {
41-
register_fsa_input_adv(cur_data ? cur_data->fsa_cause : C_FSA_INTERNAL,
42-
I_NULL, cur_data ? cur_data->data : NULL,
48+
enum crmd_fsa_cause cause = C_FSA_INTERNAL;
49+
ha_msg_input_t *cur_input = NULL;
50+
51+
if (cur_data != NULL) {
52+
cause = cur_data->fsa_cause;
53+
cur_input = cur_data->data;
54+
}
55+
register_fsa_input_adv(cause, I_NULL, cur_input,
4356
controld_globals.fsa_actions, TRUE, __func__);
4457
}
4558

46-
/* reset the action list */
4759
crm_info("Resetting the current action list");
4860
fsa_dump_actions(controld_globals.fsa_actions, "Drop");
4961
controld_globals.fsa_actions = A_NOTHING;
5062

51-
/* register the error */
63+
// Register the error
5264
register_fsa_input_adv(C_FSA_INTERNAL, input, new_data, A_NOTHING, TRUE,
5365
raised_from);
5466
}

0 commit comments

Comments
 (0)