|
36 | 36 | register_fsa_error_adv(enum crmd_fsa_input input, fsa_data_t *cur_data, |
37 | 37 | ha_msg_input_t *new_data, const char *raised_from) |
38 | 38 | { |
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 | + */ |
40 | 47 | 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, |
43 | 56 | controld_globals.fsa_actions, TRUE, __func__); |
44 | 57 | } |
45 | 58 |
|
46 | | - /* reset the action list */ |
47 | 59 | crm_info("Resetting the current action list"); |
48 | 60 | fsa_dump_actions(controld_globals.fsa_actions, "Drop"); |
49 | 61 | controld_globals.fsa_actions = A_NOTHING; |
50 | 62 |
|
51 | | - /* register the error */ |
| 63 | + // Register the error |
52 | 64 | register_fsa_input_adv(C_FSA_INTERNAL, input, new_data, A_NOTHING, TRUE, |
53 | 65 | raised_from); |
54 | 66 | } |
|
0 commit comments