HomeClusterLabs Projects

Avoid double call to podman inspect in podman_simple_status()

Description

Avoid double call to podman inspect in podman_simple_status()

Right now podman_simple_status() does the following:

  • It calls container_exists() which then calls "podman inspect --format {{.State.Running}} $CONTAINER | egrep '(true|false)' >/dev/null 2>&1"
  • Then it calls "podman inspect --format {{.State.Running}} $CONTAINER 2>/dev/null"

This duplication is unnecessary and we can rely on the second podman inspect
call. We need to do this because podman inspect calls are very expensive as
soon as moderate I/O kicks in.

Tested as follows:

  1. Injected the change on an existing bundle-based cluster
  2. Observed that monitoring operations kept working okay
  3. Verified by adding set -x that only a single podman inspect per monitor operation was called (as opposed to two before)
  4. Restarted a bundle with an OCF resource inside correctly
  5. Did a podman stop of a bundle and correctly observed that:

5.a) It was detected as non running:

  • haproxy-bundle-podman-1_monitor_60000 on controller-0 'not running' (7): call=192, status=complete, exitreason='', last-rc-change='Wed Jun 12 09:22:18 2019', queued=0ms, exec=0ms

5.b) It was correctly started afterwards

Signed-off-by: Michele Baldessari <michele@acksyn.org>

Details

Provenance
Michele Baldessari <michele@acksyn.org>Authored on Jun 12 2019, 5:29 AM
Parents
rR169b75589524: Merge pull request #1352 from oalbrigt/dhcpd-selinux-restore-context
Branches
Unknown
Tags
Unknown

Event Timeline