HomeClusterLabs Projects

Low: libcrmcommon: wait 500ms before IPC connection retry

Description

Low: libcrmcommon: wait 500ms before IPC connection retry

Previously, pcmk_ipc_connect() had a single, immediate re-attempt if the
connection failed with EAGAIN. Separately, connect_and_send_attrd_request() did
up to 5 attempts to call pcmk_ipc_connect() with an increasing delay between
them, for EAGAIN or EALREADY.

This was redundant, so now a new internal function pcmk__ipc_connect() takes
the number of retries, and the delay increment is 500ms rather than 1s (so the
maximum wait for 5 failed attempts is 5s rather than 10s).

Also, pcmk_ipc_connect() logged an error for two types of failure but no
others, and callers logged errors as appropriate. The callers have better
context, so don't log above info level in pcmk__ipc_connect().

pcmk_ipc_connect() becomes a wrapper for pcmk__ipc_connect(). This means
callers now get the 500ms wait before the single retry. As of this commit,
nothing else uses the new function.

Details

Provenance
kgaillotAuthored on Jun 29 2023, 11:23 AM
Parents
rPf6f991a16020: Log: various: use pcmk__connect_generic_ipc() instead of crm_ipc_connect()
Branches
Unknown
Tags
Unknown