Menu

#220 ExternalProgramBase output threads still running

0.8.4.0
closed-fixed
Tasks (408)
5
2004-11-03
2004-10-11
Twan Jacobs
No

We are experiencing strange behaviour with the console
output streams of ExternalProgramBase. After the main
process exits, the output streams are still running in
their respective threads. This causes output of different
NAnt tasks to be 'printed' through each other.

In the uploaded file you will find a fragment of our
console output. It's quite clear that the output of the
first tasks mingles through the second task's output.

Proposed resolution: add a new TaskAttribute to indicate
forced waiting for thread exit...

change the following lines:
// Wait for the threads to terminate
outputThread.Join(2000);
errorThread.Join(2000);
_htThreadStream.Clear();
to:
// Wait for the threads to terminate
if (_forceThreadExit)
{
outputThread.Join();
errorThread.Join();
}
else
{
outputThread.Join(2000);
errorThread.Join(2000);
}
_htThreadStream.Clear();

Discussion

  • Twan Jacobs

    Twan Jacobs - 2004-10-11

    Mingled console output

     
  • Gert Driesen

    Gert Driesen - 2004-10-11

    Logged In: YES
    user_id=707851

    Would it be possible to attach a repro for this issue ?

     
  • Twan Jacobs

    Twan Jacobs - 2004-10-12

    Logged In: YES
    user_id=595447

    The problem occurs in a rather large build process...
    I will try to find some time and create a small example with
    the same effects. Don't hold your breath, it will take a few
    days ;-)

     
  • Gert Driesen

    Gert Driesen - 2004-11-03

    Logged In: YES
    user_id=707851

    This should now be fixed in cvs (and the next nightly build).

    Please reopen this bug report if you can still reproduce this
    issue with the next nightly build (or release).

     
  • Gert Driesen

    Gert Driesen - 2004-11-03
    • assigned_to: nobody --> drieseng
    • status: open --> closed-fixed
     

Log in to post a comment.