LP #1070434: pt-stalk --no-stalk and --iterations 1 don't wait for the collect

Description

**Reported in Launchpad by Daniel Nichter last update 16-11-2012 00:08:50

A pt-stalk does:

$trunk/bin/pt-stalk --iterations 1 --dest $dest --variable Uptime --threshold $threshold --cycles 2 --run-time 2 --pid $pid_file – --defaults-file=$cnf >$log_file 2>&1

It means to test --run-time, but it was failing sporadically. Turns out, on fast systems (a rare case where being slow actually makes the test work) pt-stalk runs, triggers, collect subprocess starts, then pt-stalk exists because there's no more iterations. When the tool exists, it kills the collect subprocess, so nothing is collected.

Environment

None

Smart Checklist

Activity

Show:

lpjirasync January 24, 2018 at 4:00 PM

**Comment from Launchpad by: Daniel Nichter on: 24-10-2012 00:28:30

So the "fix" was to wait --run-time * 3 before exiting. As the new docu says, this usually won't happen because the tool runs forever by default, else if running --no-stalk or --iterations 1, then unless the system is really slow, the wait in collect() (bug 1047701) should have already killed anything. At worse it just means the tool takes some more time to exit, but then again, if a processes is hung or spinning out of control, this will kill it explicitly (else it may continue to run, then zombie, etc.)

lpjirasync January 24, 2018 at 4:00 PM

**Comment from Launchpad by: Daniel Nichter on: 24-10-2012 00:09:25

t/pt-stalk passes on all boxes with all the new waiting, though the Ubuntu 12 box is pretty damn slow, slower than we can even reasonably wait for.

lpjirasync January 24, 2018 at 4:00 PM

**Comment from Launchpad by: Daniel Nichter on: 23-10-2012 20:43:47

Correction: it doesn't kill the collect subprocess, it just messes up testing because the tool finishes yet there are still collector subprocesses running.

Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 4:00 PM
Updated January 24, 2018 at 4:00 PM
Resolved January 24, 2018 at 4:00 PM