-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: tools: crm_mon --one-shot fails while pacemaker is shutting down
crm_mon --one-shot checks the pacemakerd state before trying to get a CIB connection. If pacemakerd is shutting down, it returns ENOTCONN. This can cause a resource agent that calls crm_mon (for example, ocf:heartbeat:pgsql) to fail to stop during shutdown. This is a regression introduced by commit 3f342e3. crm_mon.c:pacemakerd_status() returns pcmk_rc_ok if pacemakerd is shutting down, since 49ebe4c and 46d6edd (fixes for CLBZ#5471). 3f342e3 refactored crm_mon --one-shot to use library functions. pcmk__status() now does most of the work, calling pcmk_status.c:pacemakerd_status(). That function returns ENOTCONN if pacemakerd is shutting down. As a result, we don't try to connect to the CIB during shutdown. Here we update pcmk__status() to use pcmk__pacemakerd_status() instead of a static and mostly redundant pacemakerd_status(). It receives the pacemakerd state via an output pointer argument. If pacemakerd is running or shutting down (or if we get an EREMOTEIO rc), we try connecting to the fencer and CIB. However, as long as we successfully get the pacemakerd state, we return success from pcmk__status(), since we did obtain the cluster status. A couple of minor notes: * pcmk__status() now takes a timeout argument that it passes to pcmk__pacemakerd_status(). timeout == 0 uses pcmk_ipc_dispatch_sync, matching the old implementation. A positive timeout uses pcmk_ipc_dispatch_main. * pcmk_cluster_queries.c:ipc_connect() no longer always prints a "Could not connect" error for EREMOTEIO. The caller may consider it OK. Fixes T579 Fixes CLBZ#5501 Signed-off-by: Reid Wahl <[email protected]>
- Loading branch information
Showing
4 changed files
with
63 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters