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 2008/12/04 15:24:57 UTC

DO NOT REPLY [Bug 46338] New: Starting forked java process cause a lot of blocking threads in Ant

https://issues.apache.org/bugzilla/show_bug.cgi?id=46338

           Summary: Starting forked java process cause a lot of blocking
                    threads in Ant
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: arjan.schaaf@luminis.nl


Created an attachment (id=22989)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22989)
Test Java class

We are running into some problems after running a lot of integration tests in
our build. After a lot of trail & error we ran into a situation with Ant. We
suspect that this might cause our problems.

We created a simple test (see attachemts) to reproduce this problem.
How to test:
1. Compile the class
2. Run the ant script
3. Connect to the ant process using JConsole

What are the results?

1. For each antcall to the target Blah a java process is forked.
2. In JConsole we see at that moment that a couple of java threads are created
(3 or 4)
3. When the forked process is finished, the threads created disappear. Well,
all disappear but one! For each forked process a thread remains in a blocked
state.

So after many antcalls starting these forked processes the number of blocking
threads starts to get out of hands.

I would expect all threads associated in the ant process with the forked java
process would be cleaned up after the forked process is done. It appears this
is not the case.

As we suspect this being the cause of some of our nightly builds that just seem
to hang after a while, we hope somebody has ideas on how to approach this
subject!


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46338] Starting forked java process cause a lot of blocking threads in Ant

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





--- Comment #2 from Stefan Bodewig <bo...@apache.org>  2008-12-04 11:42:34 PST ---
Are you using the forked process' input stream in any way?  If not, can you add
inputstring="" to your <java> tasks and see whether it helps in any way?

I suspect it is the Thread pumping input and setting inputstring to an empty
string should terminate that thread immediately.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46338] Starting forked java process cause a lot of blocking threads in Ant

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





--- Comment #1 from Arjan Schaaf <ar...@luminis.nl>  2008-12-04 06:25:56 PST ---
Created an attachment (id=22990)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22990)
Build file to reproduce test


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46338] Starting forked java process cause a lot of blocking threads in Ant

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


Arjan Schaaf <ar...@luminis.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




--- Comment #3 from Arjan Schaaf <ar...@luminis.nl>  2008-12-11 00:39:08 PST ---
Thanks for the quick response. This change really helps in controlling the
number of threads created.
Wouldn't it be a good idea to make this default behaviour?

Arjan


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46338] Starting forked java process cause a lot of blocking threads in Ant

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





--- Comment #4 from Stefan Bodewig <bo...@apache.org>  2008-12-11 20:55:39 PST ---
it would have been a good idea to make it the default behavior when we added
input handling, now it would be too late (we'd break existing build files with
a change).


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.