Skip to content

Conversation

@kolyshkin
Copy link

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.

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. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. Check command.Run error, print it out (as debug only). 2. Simplify verifyOnlyOne() return values (bool is enough). 3. Add more logging. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Author

@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
Copy link
Author

CI failure is unrelated:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant