[Buildbot-devel] Detect termination of shellcommand due to timeout

Marco listaddr at gmail.com
Sun Oct 16 18:47:39 UTC 2011


2011/10/16 Dustin J. Mitchell <dustin at v.igoro.us>:
> On Sun, Oct 16, 2011 at 9:37 AM, Marco <listaddr at gmail.com> wrote:
>> Does that make sense? Specifically, beside style matters, is there
>> more that can be checked in addition to cmd.rc being -1? Thanks.
>
> I think that's probably sufficient, although it will also capture
> slave-side exceptions.  The other option is to parse the logfile, but
> that may be more than you need in this case.

Thanks. However, I feel I'm still missing something. It looks that
when a process is killed it the cmd.rc == -1 test isn't always true.
And indeed I see different messages in the slave's log:

[-] command timed out: 1200 seconds without output, attempting to kill
[-] trying to kill process group 32450
[-]  signal 9 sent successfully
[-] command finished with signal 9, exit code None, elapsedTime: 2288.059656

But other times I get:

[-] command timed out: 1200 seconds without output, attempting to kill
[-] trying to kill process group 12546
[-]  signal 9 sent successfully
[-] command finished with signal None, exit code 2, elapsedTime: 2380.285047

and the cmd.rc == -1 test misses the second case. Now:

- why does that happen? I would expect the program to be terminated by
the signal in the second case too.
- if parsing the log is the only option to catch those cases, I'm
willing to go that route, if someone is so kind to give me some
pointers to start from.

Thanks.




More information about the devel mailing list