Check the File, Not the Log

Check the file first. Not the log, the file. That is the whole method, and the run below is why it is the method.
A benchmark run died at item 53 of 90, killed with the terminal session. No error line, no exit message. The last log line was the start banner. That is the shape of the failure: a dead run writes nothing, and a quiet run writes nothing, and the log cannot tell those two apart. The first thing to check after a kill like that is the age of the last write, not the last line of the log.
The run I killed to measure this was the same shape: 90 items, about a second and a half each, one result line and one log line per item as it goes. SIGKILL to the whole process group at item 53, 78 seconds in. Then three signals sampled at one, three and five minutes after the kill.
| Signal | +1 min | +3 min | +5 min |
|---|---|---|---|
| Log tail | cannot tell, last line "item 53/90 done" | cannot tell, byte-identical | cannot tell, byte-identical |
| Results file, last-write age | 60 s old, 53 items, dead | 180 s old, 53 items, dead | 300 s old, 53 items, dead |
| Does the pid exist | alive, wrong | alive, wrong | alive, wrong |
| Process state column | dead, Z, defunct |
dead, Z, defunct |
dead, Z, defunct |
The check, in order, and why the order matters:
First, the file's last-write age against the job's own rhythm. Sixty seconds of silence against a 1.5-second item pace is 40 missed writes. One missed write is already suspicious and forty is a verdict. The age only means something if you know the pace, so know the pace first. A job that writes every ten minutes looks dead by this test while perfectly alive. The signal is not "the file is old". It is "the file is older than the job's own rhythm".
Second, the log tail, and only to confirm what the file already said. The log never corrected itself at any sample. At five minutes it said the same three lines it said at one minute, and it would have said them at fifty. A killed job writes no farewell, so waiting for an error line is waiting for a message that was never written. The log is a record of what the run did. It is not a heartbeat.
Third, the process state, and never bare pid existence. Asking whether the pid existed answered "alive" at all three samples, because the dead process lingered as a zombie: the parent never reaped it, so the pid was still there with nothing behind it. The state column said Z, defunct, at the very first check. Existence is not aliveness. A pid can exist and be dead, and the one letter in the state column is what separates the two. In the real case that started this, the pid would have vanished instead of lingering, because the window that owned the job died with it, so a pid check would have worked there. My zombie is partly an artifact of how I staged the kill, with a parent that stayed alive. The lesson holds in both directions: a pid that exists can be dead, and a pid that is gone is the only clean answer that check gives.
The claim, then, is simple: the log is the worst aliveness signal you can check, and the file's last-write age is the best one you already have. The log tells you what happened. The file tells you when something last happened. For a run that might be dead, when is the only question that matters.
Limits, stated plainly: one staged kill, one job shape, a sampling cadence I chose. The per-item compute was a hash that measured under a millisecond, so the 1.5-second pace came from a sleep, not from heavy work. The write cadence is what the experiment measured, not the compute.
What caught your dead run, and how long did you believe it was alive before you checked?
P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam
Comments
Join the discussionNo comments yet. Be the first to comment.






