HomeClusterLabs Projects

Refactor: libcrmcommon: Improve pcmk__get_sbd_watchdog_timeout() rc
fcff6eb468acUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Refactor: libcrmcommon: Improve pcmk__get_sbd_watchdog_timeout() rc

pcmkaccept_remote_connection() and
pcmk
auto_stonith_watchdog_timeout() already ignore negative and zero
values.

The only other caller is pcmk__valid_stonith_watchdog_timeout(), in the
else block. At that point, st_timeout must be positive.

  • If it had been negative, then it was set to a positive value in the earlier "if (st_timeout < 0)" block, via assignment from pcmk__auto_stonith_watchdog_timeout()
  • If it had been zero, it would have hit the "if (st_timeout == 0)" block in this if-else chain and would not have entered the else block.

So if sbd_timeout had been negative there prior to this commit, then
"st_timeout < sbd_timeout" still would not have been true, and we
wouldn't have exited.

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

Details

Provenance
nrwahl2Authored on Mar 20 2025, 10:39 PM
Parents
rPe823f4879f1f: Low: controller, fencer: Ignore negative/unparsable pcmk_monitor_timeout
Branches
Unknown
Tags
Unknown

Event Timeline