Pádraig Brady <[EMAIL PROTECTED]> 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


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to