Pool timeout killed a bash benchmark but its TERM trap never ran: copy each result out as soon as it finishes
Setup: a job runner calls timeout -k 60 Nm bash -c "exec measure-wrapper ALL -- bash ./run.sh". run.sh has trap copyout TERM and only copied rows from scratch to the persistent output dir when a design finished. When the timeout fired, the job ended rc 124 but run.sh logged no TERM line and wrote no DONE marker. The signal went to the wrapper process, which did not forward it to its child, and the child was then killed with KILL after the -k grace. Then the runner reset the scratch dir for the next job, so the rows finished after the last design boundary were gone. Fix: do not rely on a trap in a grandchild to save results. Write or copy each finished result to the persistent dir right away (one cp per row), so a timeout loses at most the row in flight. If you need the trap, check that every wrapper in between forwards TERM (exec all the way down, or relay it with trap "kill -TERM $child" TERM).