HomeClusterLabs Projects

Refactor: libpacemaker: Improve rc checking in pcmk_cluster_queries.c

Description

Refactor: libpacemaker: Improve rc checking in pcmk_cluster_queries.c

Here we initialize data.rc to EAGAIN for each query (except
pcmk__list_nodes()) and set it to pcmk_rc_ok explicitly upon receiving a
good reply. Thus we avoid false positives and ensure that the return
code is predictable when we don't receive a reply.

This also renders data.reply_received redundant -- if data.rc != EAGAIN,
we know we received a reply (good or bad) or an otherwise bad event, and
we should stop polling.

Finally, now we initialize only those members of data_t objects that are
actually used within a given function and its callback. I like to be
explicit, but it was going to get out of hand if we continued that trend
with the new node_info member.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Nov 9 2022, 2:10 AM
Parents
rPd03b7a549d63: Feature: tools: crm_mon now shows last_update origin
Branches
Unknown
Tags
Unknown