Hi Dave,
We added a few more debug statements in ProcessExecutor.cs and prefixed our special ones with TDM.
Here's the relevant sections of a log file from yesterday when we reproduced the problem.
The two projects Modeling1A and Basic seemed to start at almost the same time:
2009-11-16 14:35:55,449 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] Starting process [C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe] in working directory [D:\Dispatcher\Tools] with arguments [D:\Dispatcher\Tools\RunTask.ps1]
2009-11-16 14:35:55,464 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] Starting process [C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe] in working directory [D:\Dispatcher\Tools] with arguments [D:\Dispatcher\Tools\RunTask.ps1]
2009-11-16 14:35:55,480 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] TDM:Calling process.WaitHandle.WaitAll
2009-11-16 14:35:55,495 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] TDM: errorStreamClosed Handle:2576
2009-11-16 14:35:55,480 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] TDM:Calling process.WaitHandle.WaitAll
2009-11-16 14:35:55,511 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] TDM: outputStreamClosed Handle:3076
2009-11-16 14:35:55,527 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] TDM: processExited Handle:2656
2009-11-16 14:35:55,511 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] TDM: errorStreamClosed Handle:2680
2009-11-16 14:35:55,542 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] TDM: outputStreamClosed Handle:2792
2009-11-16 14:35:55,542 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] TDM: processExited Handle:3660
Then about an hour later, the Basic project was done and exited:
2009-11-16 15:42:30,785 [60:DEBUG] [2007.4 Plant EUS - Run QTP - Basic C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe] Done running task @ 11/16/2009 15:42:30
2009-11-16 15:42:30,785 [26:DEBUG] TDM: ExitedHandler calling processExited.Set() Handle:3660
But notice that it didn't close the errorStream or outputStream.
After 4.5 hours the Modeling1A project was finally done and exited:
2009-11-16 19:00:12,183 [29:DEBUG] [2007.4 Plant EUS - Run QTP - Modeling1A C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe] Done running task @ 11/16/2009 19:00:12
2009-11-16 19:00:12,198 [50:DEBUG] TDM: CollectOutput calling System.Threading.ManualResetEvent.Set() Handle:2680
2009-11-16 19:00:12,198 [49:DEBUG] TDM: CollectOutput calling System.Threading.ManualResetEvent.Set() Handle:2576
2009-11-16 19:00:12,198 [60:DEBUG] TDM: CollectOutput calling System.Threading.ManualResetEvent.Set() Handle:2792
2009-11-16 19:00:12,198 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] process.WaitHandle.WaitAll returned True
2009-11-16 19:00:12,198 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] TDM: errorStreamClosed Handle:2680
2009-11-16 19:00:12,198 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] TDM: outputStreamClosed Handle:2792
2009-11-16 19:00:12,198 [2007.4 Plant EUS - Run QTP - Basic:DEBUG] TDM: processExited Handle:3660
2009-11-16 19:00:12,198 [29:DEBUG] TDM: CollectOutput calling System.Threading.ManualResetEvent.Set() Handle:3076
2009-11-16 19:00:12,198 [26:DEBUG] TDM: ExitedHandler calling processExited.Set() Handle:2656
2009-11-16 19:00:12,198 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] process.WaitHandle.WaitAll returned True
2009-11-16 19:00:12,198 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] TDM: errorStreamClosed Handle:2576
2009-11-16 19:00:12,214 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] TDM: outputStreamClosed Handle:3076
2009-11-16 19:00:12,214 [2007.4 Plant EUS - Run QTP - Modeling1A:DEBUG] TDM: processExited Handle:2656
2009-11-16 19:00:12,245 [2007.4 Plant EUS - Run QTP - Basic:INFO] Integration complete: Success - 11/16/2009 7:00:12 PM
2009-11-16 19:00:12,245 [2007.4 Plant EUS - Run QTP - Modeling1A:INFO] Integration complete: Success - 11/16/2009 7:00:12 PM
Notice how the CollectOutput is getting called 4 times and is triggering errorStreamClosed and outputStreamClosed for both Modeling1A and Basic.
Eventually both projects are successfull, but the Basic project is being tied up for 3.5 hours longer than necessary.
Christian