Don't buffer output from configuration scripts

Issue #695 closed
Erik Schnetter created an issue

Output from configuration scripts is buffered, and is only output after the script has finished. This is inconvenient for long-running scripts. Instead, the output should be shown right away.

This buffering is done in file lib/sbin/ConfigScriptParser.pl, which uses Perl backquotes `` to collect all of the script's output. Instead, Cactus should use a pipe to read the script's output line-by-line, and process it immediately.

Keyword:

Comments (4)

  1. Roland Haas
    • changed status to open
    • removed comment

    I am not sure I understand all the perl constructs used.

    In line 35 a select is used to make $lines the current filehandle. However according to [http://perldoc.perl.org/functions/select.html] select sets the default output filehandle, while $files is used for input (of the script's output). So it seems to make no sense to set its buffering (see [http://perldoc.perl.org/perlvar.html]). <Nitpicking>Is $line_number actually used anywhere? It is not a drop in replacement since it adds a bit of extra output telling the user which script runs. Not sure how helpful it is in a parallel build.</Nickpicking> (yes I have read the "How to review patches guide" hence the tags).

    Otherwise the patch looks fine.

  2. Erik Schnetter reporter
    • changed status to resolved
    • removed comment

    I remove the select magic.

    Yes, $line_number is used when outputting an error message.

  3. Log in to comment