[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add timeout utility
From: |
Bo Borgerson |
Subject: |
Re: [PATCH] Add timeout utility |
Date: |
Wed, 2 Apr 2008 08:09:14 -0400 |
Pádraig Brady <address@hidden> wrote:
> Subject: [PATCH] Add new program: timeout
Great idea for a tool!
Have you considered an alternate run-mode where it could operate as a
filter and timeout on 'inactivity' of the pipeline?
If, for instance, I have a pipeline that processes a lot of data and
could legitimately take anywhere from a minute to an hour, it's
difficult to set an absolute timeout that doesn't risk chopping off
the end of the stream. Then, with such a large timeout, my pipeline
could stall in the first ten seconds and I wouldn't know for a long
time.
If, on the other hand, I could say that there shouldn't ever be thirty
seconds without a buffer's worth of data coming through, then I could
set the timeout very low and know soon after a blockage formed.
For example:
$ sort -m inputs/* | timeout --inactivity 1m program_prone_to_stalling
Where timeout would open a pipe and dup2 the read end to child's
STDIN_FILENO before exec'ing.
If this sounds like a worthwhile extension I'd be happy to get to work
on it and submit a patch once your initial version has settled in.
Thanks,
Bo
Re: [PATCH] Add timeout utility, Pádraig Brady, 2008/04/03