mq-container icon indicating copy to clipboard operation
mq-container copied to clipboard

runmqserver: fix/improve verifySingleProcess

Open kolyshkin opened this issue 3 years ago • 2 comments

A couple of patches to improve the runmqserver check for being the only process.

1. cmd/runmqserver.verifySingleProcess: optimize

Instead of using ps, which reads three /proc files per each process (stat, status, and cmdline), use pgrep which only reads cmdline.

Also, pgrep output is simpler -- it only lists PIDs, one per line, so to find out the number of processes we just need to count newlines.

2. cmd/runmqserver.verifySingleProcess: improve

  1. Check command.Run error, print it out (as debug only).

  2. Simplify verifyOnlyOne() return values (bool is enough).

  3. Add more logging.

kolyshkin avatar Sep 03 '20 00:09 kolyshkin

@sdmarshall79 @parrobe @LPowlett PTAL

CI failure is unrelated:

Step 3/103 : FROM registry.redhat.io/ubi8/go-toolset:1.13.4-22 as builder Get https://registry.redhat.io/v2/ubi8/go-toolset/manifests/1.13.4-22: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication Makefile:267: recipe for target 'build-devserver' failed make: *** [build-devserver] Error 1 The command "bash -e travis-build-scripts/run.sh" exited with 2.

kolyshkin avatar Sep 03 '20 00:09 kolyshkin

CI failure is unrelated:

Apparently $(REGISTRY_USER) and $(REGISTRY_PASS) are not set in Travis?

kolyshkin avatar Sep 03 '20 00:09 kolyshkin