Restart the right process OPS-2240

OpenShell basics · Easy · Investigate · about 15 min ·Linux

Lab machine

A private Linux machine with the problem already set up. Sessions last up to 60 minutes.
Teo Marin opened OPS-2240 at 11:15SEV-3

Waybill on depot-west stopped serving at 09:44. Next to it, a batch job on the manifests database has been running for three hours and must not be interrupted.

The Waybill server on this host is wedged: its worker pool is exhausted and it answers every health check with 503 until it is restarted. Restarting is safe; it holds no state.

"The batch job also has waybill in its name. If it dies halfway, we restore the manifest archive from last night's backup and lose this morning. Find the server by what it does, not by its name." (Teo)

Two processes match "waybill". One listens on a port and serves requests. The other one does not listen on anything.

Your task

Find the PID of the process listening on the port in opt/waybill/port, stop only that process, then start a fresh server with bin/start-waybill and confirm /healthz answers 200. Do not use pkill or killall.

On the machine

  • ps -ef, pgrep -af waybill
  • ss -ltnp shows which PID listens on which port
  • opt/waybill/port, var/log/waybill.log
  • bin/start-waybill

Timeline

08:10Dmitri starts a batch job on the manifests database (about four hours).
09:44Waybill: worker pool exhausted, answering 503.
11:10Someone in chat suggests pkill -f waybill.
11:15Teo: "Please do not. Restart only the server."

Done when

  1. The batch job is still running.
  2. The wedged server is gone and a fresh one answers /healthz with 200.

Hints

Hint 1

ps -ef | grep waybill shows both processes. Read the full command lines.

Hint 2

ss -ltnp shows which PID listens on the port in opt/waybill/port.

Hint 3

kill <PID> stops one process. pkill -f waybill would stop both.

Hint 4

Then run bin/start-waybill and curl the health URL.

Show the solution

ss -ltnp "sport = :$(cat opt/waybill/port)" shows the server PID. kill that PID, run bin/start-waybill, then curl http://127.0.0.1:$(cat opt/waybill/port)/healthz.