Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
pacemaker.13547
pacemaker-libpe_status-ability-log-warning-once...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker-libpe_status-ability-log-warning-once.patch of Package pacemaker.13547
commit f6795045ff8e23ac995c75acb83adce65f07c3ee Author: Ken Gaillot <kgaillot@redhat.com> Date: Mon Sep 25 11:32:30 2017 -0500 Refactor: libpe_status: generalize ability to log warning only once Index: pacemaker/lib/pengine/unpack.c =================================================================== --- pacemaker.orig/lib/pengine/unpack.c +++ pacemaker/lib/pengine/unpack.c @@ -46,6 +46,9 @@ gboolean unpack_rsc_op(resource_t * rsc, enum action_fail_response *failed, pe_working_set_t * data_set); static gboolean determine_remote_online_status(pe_working_set_t * data_set, node_t * this_node); +// Bitmask for warnings we only want to print once +uint32_t pe_wo = 0; + static gboolean is_dangling_container_remote_node(node_t *node) { @@ -541,7 +544,6 @@ handle_startup_fencing(pe_working_set_t { static const char *blind_faith = NULL; static gboolean unseen_are_unclean = TRUE; - static gboolean need_warning = TRUE; if ((new_node->details->type == node_remote) && (new_node->details->remote_rsc == NULL)) { /* ignore fencing remote-nodes that don't have a conneciton resource associated @@ -554,12 +556,7 @@ handle_startup_fencing(pe_working_set_t if (crm_is_true(blind_faith) == FALSE) { unseen_are_unclean = FALSE; - if (need_warning) { - crm_warn("Blind faith: not fencing unseen nodes"); - - /* Warn once per run, not per node and transition */ - need_warning = FALSE; - } + pe_warn_once(pe_wo_blind, "Blind faith: not fencing unseen nodes"); } if (is_set(data_set->flags, pe_flag_stonith_enabled) == FALSE Index: pacemaker/lib/pengine/unpack.h =================================================================== --- pacemaker.orig/lib/pengine/unpack.h +++ pacemaker/lib/pengine/unpack.h @@ -97,4 +97,23 @@ extern const char *param_value(GHashTabl do_crm_log(log_level, fmt, ##args); \ } +// Some warnings we don't want to print every transition + +enum pe_warn_once_e { + pe_wo_blind = 0x0001, +}; + +extern uint32_t pe_wo; + +#define pe_warn_once(pe_wo_bit, fmt...) do { \ + if (is_not_set(pe_wo, pe_wo_bit)) { \ + if (pe_wo_bit == pe_wo_blind) { \ + crm_warn(fmt); \ + } else { \ + pe_warn(fmt); \ + } \ + set_bit(pe_wo, pe_wo_bit); \ + } \ + } while (0); + #endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor