HomeClusterLabs Projects

Fix: tools: Handle large timeouts correctly in crm_resource --wait
5eb7c2960933Unpublished

Unpublished Commit ยท Learn More

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

Description

Fix: tools: Handle large timeouts correctly in crm_resource --wait

Previously, if the --timeout value parsed to a value greater than
(UINT_MAX - 999), the wait timeout would overflow. The effective timeout
would be either 0 seconds or 1 second. This is because 999 was added to
the guint value before passing it to pcmk__timeout_ms2s().

Now, we simply pass the timeout in milliseconds to
pcmk__timeout_ms2s(), without adding 999.

This implies a slight behavior change. Previously, timeouts were always
rounded up to the next greatest second. Now, they're rounded to the
nearest second. For example, previously:

  • timeout values between 1ms and 500ms => wait timeout of 1 second
  • timeout values between 501ms and 1500ms => wait timeout of 2 seconds
  • timeout values between 1501ms and 2500ms => wait timeout of 3 seconds
  • and so on

Now:

  • timeout values between 1ms and 1499ms => wait timeout of 1 second
  • timeout values between 1500ms and 2499ms => wait timeout of 2 seconds
  • timeout values between 2500ms and 3499ms => wait timeout of 3 seconds
  • and so on

The previous rounding behavior has existed since crm_resource --wait was
added by 424afcdf.

Fixes RHEL-45869
Fixes RHEL-86148
Closes T841

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

Details

Provenance
nrwahl2Authored on Fri, Sep 5, 11:35 PM
Parents
rP4c9bf7a8a31f: Merge pull request #3960 from clumens/shlex-split-dumb
Branches
Unknown
Tags
Unknown

Event Timeline