You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Marco Ferrante (JIRA)" <ji...@apache.org> on 2008/12/31 15:16:44 UTC

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

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
            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.


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

Posted by "Milos Kleint (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Milos Kleint updated EXEC-33:
-----------------------------

    Attachment: EXEC33.patch

attached is a suggested patch that was tested with a modified exec-maven-plugin (modified to use commons-exec instead of plexus-utils for execution)



> 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.0
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Benjamin Bentmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664043#action_12664043 ] 

Benjamin Bentmann commented on EXEC-33:
---------------------------------------

bq. It depends on the implementation of the JVM and the underlaying platform. On Solaris read() will be interrupted 
Correct, additionally depends on the JVM flags passed in (UseVMInterruptibleIO).

My intention was merely to point out that we have no reliable/general/platform-independent way of interrupting {{read()}}.

> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730914#action_12730914 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

I'm starting to cut an RC for commons-exec-1.0.1 ...

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Marco Ferrante (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marco Ferrante updated EXEC-33:
-------------------------------

    Attachment: PumpStreamHandler.patch

If I understand your suggestion correctly, this patch should be enough to work around the problem; at least, it passes the test case.

> 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
>         Attachments: PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Benjamin Bentmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663915#action_12663915 ] 

Benjamin Bentmann commented on EXEC-33:
---------------------------------------

The problematic code can be reduced to:
{code:java}
InputStream is = System.in;
OutputStream os = System.out;

final byte[] buf = new byte[4096];
int length;
while ((length = is.read(buf)) > 0) {
    os.write(buf, 0, length);
}
System.out.println("DONE");
{code}
i.e. this hangs, too. It appears that's a basic Java issue, cf. Sun bugs [#4514257|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4514257], [#4385444|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4385444] and related. Basically {{System.in}} is an open but empty stream, so the call {{InputStream.read()}} will block infinitely. As the mentioned Sun issues point out, {{Thread.interrupt()}} doesn't help either once the blocking call to {{read()}} has been made.

{{InputStream.available()}} seems the only non-blocking way to detect the empty state of the stream but unfortunately it doesn't detect whether the stream is closed.

Maybe one needs a special {{StreamPumper}} (e.g. subclass) for the {{inputThread}} that pumps the streams via polling, i.e. {{available()}} + {{read()}} + {{Thread.sleep()}}, and gets terminated when interrupted from outside, i.e. by {{PumpStreamHandler.stop()}}, instead of stream closing. When the subprocess has exited, there is no need to pump further input into it, so terminating the {{inputThread}} in {{PumpStreamHandler.stop()}} without consuming all of the input shouldn't be a problem. Surely, beauty is something else.

> 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.


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

Posted by "Milos Kleint (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706413#action_12706413 ] 

Milos Kleint commented on EXEC-33:
----------------------------------

yes, it works.
I have updated svn, rebuilt commons-exec. Used the snapshot in exec-mojo-plugin (wit simplified patch from http://jira.codehaus.org/browse/MEXEC-25.

used that exec plugin in netbeans for an app that processes output. Seems to work as expected.



> 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
>             Fix For: 1.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Milos Kleint (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12742801#action_12742801 ] 

Milos Kleint commented on EXEC-33:
----------------------------------

any updates?

The bug is still open, does it mean the patch hasn't been applied yet?

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760195#action_12760195 ] 

Henri Biestro commented on EXEC-33:
-----------------------------------

Btw, the same pb occured on Mac OSX with unit tests hanging, even with the fix.

Committed a modification:
URL: http://svn.apache.org/viewvc?rev=818863&view=rev
Log: 
On a Mac, the unit tests never finish. Culprit is InputStreamPumper which sets its stop member in the run method; however, run might really be executed after the stopProcessing method is called if the process thread completes before the InputStreamPumper starts. 

Modified: 
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/InputStreamPumper.java 

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704816#action_12704816 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

Milos, I applied the patch - can you make a quick retest so I can plan a release ... 

> 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
>             Fix For: 1.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Milos Kleint (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699060#action_12699060 ] 

Milos Kleint commented on EXEC-33:
----------------------------------

Benjamin, that would be an improvement for sure. Typically you wouldn't type as fast as 10 characters per second, but you can surely copy&paste a large amount of text and then it would be more than useful to the the inner loop to stop as well.

> 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.0
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Brett Porter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762087#action_12762087 ] 

Brett Porter commented on EXEC-33:
----------------------------------

Siegfried - did you sort them out? I think Phil's comment on commons-dev will help - if there's anything you need then please let me know.

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl updated EXEC-33:
----------------------------------

    Affects Version/s:     (was: 1.0)
                       1.0.1

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl resolved EXEC-33.
-----------------------------------

    Resolution: Fixed

Added a line in changes.xml to document the modification

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Arnaud HERITIER (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756404#action_12756404 ] 

Arnaud HERITIER commented on EXEC-33:
-------------------------------------

Hi, do you know when you'll fix this issue and when you'l release the 1.0.1 ?
It's really annoying to not being able to fix the issue we have in the Exec Mojo.
If it's too long, we'll have to see if we can use another library or if we fork yours.

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760398#action_12760398 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

Hi Arnaud and Milos,

I'm simply unable to bring the RC out of the door - I have now SSH issues after solving my SVN problems. Either you have some more patience while I'm sorting out the infrastructure or you make a private fork

Sorry for the inconvinience

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Joerg Schaible (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664028#action_12664028 ] 

joehni edited comment on EXEC-33 at 1/14/09 11:44 PM:
--------------------------------------------------------------

{quote}
As the mentioned Sun issues point out, Thread.interrupt() doesn't help either once the blocking call to read() has been made.
{quote}

This is actually not completely true. It depends on the implementation of the JVM and the underlaying platform. On Solaris read() will be interrupted and throwing an InterruptedIOException. So be prepared to deal with both situations.

      was (Author: joehni):
    {quote}
As the mentioned Sun issues point out, Thread.interrupt() doesn't help either once the blocking call to read() has been made.
{quote}

This is actually not completely true. It depends on the implementation of the JVM and the underlaying platform. On Solaris read will be interrupted and read throws an InterruptedIOException. So be prepared to deal with both situations.
  
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663498#action_12663498 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl updated EXEC-33:
----------------------------------

    Affects Version/s:     (was: 1.1)
                       1.0
        Fix Version/s: 1.1

> 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
>             Fix For: 1.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Arnaud HERITIER (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758629#action_12758629 ] 

Arnaud HERITIER commented on EXEC-33:
-------------------------------------

ok, let us know if we can help you.

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl updated EXEC-33:
----------------------------------

    Affects Version/s:     (was: 1.0)
                       1.1

> 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.1
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664498#action_12664498 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

Well, you are dodging the bullet - the question is can you do something meaningful with the redirected System.in in your application?

> 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
>         Attachments: PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700560#action_12700560 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

Milos, I'm completely busy the next few days so it looks like next weekend for the patch .... :-(

> 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.0
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762873#action_12762873 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

One more task for late night action hero - upgrade to Maven 2.2.1 to get the release candidate going ... :-)

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717610#action_12717610 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

Yes - I was sucked up in a customer project for the last two months but workload becomes normal. So I will cut an RC next week

> 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
>             Fix For: 1.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674398#action_12674398 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

Throwing an IllegalArgumentException when System.in is used to notify the user ....

> 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.0
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Milos Kleint (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12728561#action_12728561 ] 

Milos Kleint commented on EXEC-33:
----------------------------------

ping? 

I need the commons-exec released to have exec-maven-plugin released to be included in the next netbeans release. Quite a long chain, that's why I keep on pushing..

> 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
>             Fix For: 1.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664061#action_12664061 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

I think the checking System.in might solve the problem since it would be a bug to close stdin anyway - so having a smarter StreamPumper might be worth the effort. Many thanks for Benjamin and Joerg for helping me on this issue .....

> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758458#action_12758458 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

The patch is long applied but my release candidate got stuck due to M2 and SVN problems many moons ago ... I give it another go now

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl updated EXEC-33:
----------------------------------

    Affects Version/s:     (was: 1.0.1)
                       1.0
        Fix Version/s:     (was: 1.1)
                       1.0.1

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674395#action_12674395 ] 

Siegfried Goeschl commented on EXEC-33:
---------------------------------------

Fixing this correctly on all platforms does not look easy so I will look at it after the first release.

> 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.0
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Benjamin Bentmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698833#action_12698833 ] 

Benjamin Bentmann commented on EXEC-33:
---------------------------------------

Milos, shouldn't the inner {{while}} loop of {{InputStreamPumper.run()} also check the {{stop}} flag to make sure processing stops when requested and not when the input is exhausted?

> 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.0
>         Environment: Windows Vista
>            Reporter: Marco Ferrante
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Joerg Schaible (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664028#action_12664028 ] 

Joerg Schaible commented on EXEC-33:
------------------------------------

{quote}
As the mentioned Sun issues point out, Thread.interrupt() doesn't help either once the blocking call to read() has been made.
{quote}

This is actually not completely true. It depends on the implementation of the JVM and the underlaying platform. On Solaris read will be interrupted and read throws an InterruptedIOException. So be prepared to deal with both situations.

> 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.


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

Posted by "Arnaud HERITIER (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760399#action_12760399 ] 

Arnaud HERITIER commented on EXEC-33:
-------------------------------------

I prefer to wait some days/weeks before to create a private fork. Thx for your help. I hope your ssh issue will be fixed soon.

> 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
>             Fix For: 1.0.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.


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

Posted by "Milos Kleint (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EXEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717601#action_12717601 ] 

Milos Kleint commented on EXEC-33:
----------------------------------

is the new release still in the pipeline?

> 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
>             Fix For: 1.1
>
>         Attachments: EXEC33.patch, PumpStreamHandler.patch
>
>
> 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.