You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2017/06/04 14:10:02 UTC

[Bug 61153] New: ExecTask closes input handle

https://bz.apache.org/bugzilla/show_bug.cgi?id=61153

            Bug ID: 61153
           Summary: ExecTask closes input handle
           Product: Ant
           Version: 1.6.2
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
          Assignee: notifications@ant.apache.org
          Reporter: espen@blikstad.no
  Target Milestone: ---

Hi

I'm trying to solve a bug in Rundeck which uses the Apache Ant libraries.
Rundeck does not compile or build any components, it runs scripts for IT
administrators.

I'm running Rundeck on Windows and I'm experiencing deadslocks. I have
discovered that serveral tools on Windows like PowerShell.exe does not handle a
closed input handle for I/O redirection. I have also experienced this with
multiple other Windows tools like cmd.exe and winrs.exe.

While debugging Rundeck i discovered that it uses Ant and creates an ExecTask
object for executing a local program. ExecTask creates a Redirector object
which in turn creates a PumpStreamHandler. The PumpStreamHandler however has a
variable called closedwhenexhausted which causes the input thread to close the
process input handle and stop the thread when no more data is available.

On Windows you cannot close the input handle until the process has completed...


Lines of code taken from StreamPumper.java. os being the output stream is the
process input stream which cannot be closed until the process is done.
##############################################
        } finally {
            if (closeWhenExhausted) {
                try {
                    os.close();
                } catch (IOException e) {
                    // ignore
                }

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61153] ExecTask closes input handle

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61153

espen@blikstad.no changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.6.2                       |1.8.3
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61153] ExecTask closes input handle

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61153

--- Comment #1 from espen@blikstad.no ---
I have forked the ant repository and created a pull request.
https://github.com/apache/ant/pull/34

-- 
You are receiving this mail because:
You are the assignee for the bug.