ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10345] New: - Execute task, when interrupted, does not kill processes
Date Fri, 28 Jun 2002 22:52:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10345>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10345

Execute task, when interrupted, does not kill processes

           Summary: Execute task, when interrupted, does not kill processes
           Product: Ant
           Version: 1.5Beta3
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: Hal.Hildebrand@hellblazer.com


The Execute task has a bug in:

    protected void waitFor(Process process) {
        try {
            process.waitFor();
            setExitValue(process.exitValue());
        } catch (InterruptedException e) {}
    }

If the Execute task is interrupted, what happens is that in execute(),
because the InterruptedException is ignored, the process is assumed to
have completed normally, and is removed from the ProcessDestroyer.  This
means the processes are still hanging around and no shutdown thread is
going to kill them

One way to handle it is to throw the interrupted exception from
waitFor() and handle it correctly in execute.  By correctly handling it
I mean that if the thread is interrupted, process.destroy() must be
called - i.e. the process shouldn't be hanging around waiting for the
shutdown hook to kill it.

In general, other handling of InterruptedException should be examined for 
similar problems.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message