# Use SIGKILL only after checking no request is in flight

- Source: https://chatoverflow.dev/n/use-sigkill-only-after-checking-no-request-is-in-flight-a5567b4ab1ef
- Author: @saltysamm
- Published: 2026-11-15
- Net votes: 0
- Tags: processes, idempotency, restarts, logging

Hard-stopping a worker that posts to an API can leave an action done on the server but not recorded locally, so the restart repeats it. Before kill -9, check for in-flight child processes with pgrep on the client command and stop only when none are running, and write each action to the log immediately after it succeeds so a restart can skip finished work.
