You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Siegfried Goeschl (JIRA)" <ji...@apache.org> on 2009/01/13 23:18:59 UTC

[jira] Issue Comment Edited: (EXEC-33) PumpStreamHandler hangs if System.in is redirect to process input stream

    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663498#action_12663498 ] 

sgoeschl edited comment on EXEC-33 at 1/13/09 2:18 PM:
----------------------------------------------------------------

Confirmed so far ...

+) the following test script hangs
+) one worker thread stll hang in  StreamPumper.java
+) Having said this I have a working test case for redirecting a FileInputStream instead of System.in so I'm a bit pussled

{noformat} 
    /**
     * Start a process and connect stdin, stdout and stderr. This 
     * test currenty hang ....
     */
    public void testExecuteWithStdin() throws Exception
    {
        CommandLine cl = new CommandLine(testScript);
        PumpStreamHandler pumpStreamHandler = new PumpStreamHandler( System.out, System.err, System.in );
        DefaultExecutor executor = new DefaultExecutor();
        executor.setStreamHandler( pumpStreamHandler );
        int exitValue = executor.execute(cl);
        assertFalse(exec.isFailure(exitValue));
    }
{noformat} 

      was (Author: sgoeschl):
    Confirmed so far ...

+) the following test script hangs
+) one worker thread stll hang in  StreamPumper.java
+) Having said this I have a working test case for redirecting a FileInputStream instead of System.in so I'm a bit pussled

    /**
     * Start a process and connect stdin, stdout and stderr. This 
     * test currenty hang ....
     */
    public void testExecuteWithStdin() throws Exception
    {
        CommandLine cl = new CommandLine(testScript);
        PumpStreamHandler pumpStreamHandler = new PumpStreamHandler( System.out, System.err, System.in );
        DefaultExecutor executor = new DefaultExecutor();
        executor.setStreamHandler( pumpStreamHandler );
        int exitValue = executor.execute(cl);
        assertFalse(exec.isFailure(exitValue));
    }

  
> PumpStreamHandler hangs if System.in is redirect to process input stream
> ------------------------------------------------------------------------
>
>                 Key: EXEC-33
>                 URL: https://issues.apache.org/jira/browse/EXEC-33
>             Project: Commons Exec
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>
> When process input is redirected using a PumpStreamHandler, e.g.
>       PumpStreamHandler streamHanlder = new PumpStreamHandler(out, err, System.in); 
>       exec.setStreamHandler(streamHanlder);
>       MockExecuteResultHandler handler = new MockExecuteResultHandler();
>       exec.execute(cl, handler);
> the process hangs and never exit.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.