Menu

Possible bug with exec on Windows

General
Todd Sykes
2014-06-22
2014-06-23
  • Todd Sykes

    Todd Sykes - 2014-06-22

    When running exec processes on Windows in parallel, processes may not be marked complete until the last one in the set completes. This is causing a problem when there is a single long running process. For example, in this definition there are 11 5-second jobs and 1 20-second job. Each time I run it, some of the 5 second jobs finish in 5 seconds and some of them finish after the 20 second job finishes. It's a different set each time. Is there a work around? I don't see the same behavior when running in a linux shell using a sleep command.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <oddjob >
    <job>
    <parallel name="a bunch of jobs">
    <jobs>
    <exec name="run something1">cmd /C ping localhost -n 5</exec>
    <exec name="run something2">cmd /C ping localhost -n 5</exec>
    <exec name="run something3">cmd /C ping localhost -n 20</exec>
    <exec name="run something4">cmd /C ping localhost -n 5</exec>
    <exec name="run something5">cmd /C ping localhost -n 5</exec>
    <exec name="run something6">cmd /C ping localhost -n 5</exec>
    <exec name="run something7">cmd /C ping localhost -n 5</exec>
    <exec name="run something8">cmd /C ping localhost -n 5</exec>
    <exec name="run something9">cmd /C ping localhost -n 5</exec>
    <exec name="run something10">cmd /C ping localhost -n 5</exec>
    <exec name="run something11">cmd /C ping localhost -n 5</exec>
    <exec name="run something12">cmd /C ping localhost -n 5</exec>
    </jobs>
    </parallel>
    </job>
    </oddjob>

     
  • Rob Gordon

    Rob Gordon - 2014-06-23

    Hi - yes you are right, I see the same thing.

    Debugging this I see that for each job the process completes, but then the job waits for stdout and stderr of the process to close. It must do this because there could be some buffered output that still needs to be captured.

    I have no idea why on windows these aren't being closed on a process by process basis but only when all processes complete - They should not be shared in any way.

    I will try and investigate further but at the moment, I'm sorry but I have no work around.

     

Log in to post a comment.