java.exe is not killed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

java.exe is not killed

Martin Ankerl
Hi all,

We use hudson on a Windows 2003 server. Whenever a build is running
that somebody stops by clicking on the [x] in hudson, Hudson is unable
to delete the workspace, this is the error message I get when trying
to rebuild the project:

started
FATAL: Unable to delete
D:\hudson\jobs\KoAgent\workspace\trunk\buildlogs\TEST-at.profactor.koagent.aco.MultipleConstrainedPickupDeliveryTest.xml
java.io.IOException: Unable to delete
D:\hudson\jobs\KoAgent\workspace\trunk\buildlogs\TEST-at.profactor.koagent.aco.MultipleConstrainedPickupDeliveryTest.xml
        at hudson.Util.deleteFile(Util.java:126)
        at hudson.Util.deleteContentsRecursive(Util.java:104)
        at hudson.Util.deleteContentsRecursive(Util.java:103)
        at hudson.Util.deleteContentsRecursive(Util.java:103)
        at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:246)
        at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:244)
        at hudson.FilePath.act(FilePath.java:191)
        at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:244)
        at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:222)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:266)
        at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:136)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:103)
        at hudson.model.Run.run(Run.java:533)
        at hudson.model.Build.run(Build.java:203)
        at hudson.model.Executor.run(Executor.java:61)

The problem is that there is still a java.exe process running that has
many of the files inside the directory open. I have to manually log in
to the server and kill the java process to be able to rebuild the
project. Is this a bug, does anyone have the same problem?

--
Martin Ankerl | http://martin.ankerl.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java.exe is not killed

Kohsuke Kawaguchi-2
Martin Ankerl wrote:
> The problem is that there is still a java.exe process running that has
> many of the files inside the directory open. I have to manually log in
> to the server and kill the java process to be able to rebuild the
> project. Is this a bug, does anyone have the same problem?

Hudson can only kill the process it launched, and when that process
launches other processes, they may or may not be killed, and that all
depends on the processes that launched them.

OK, this is awfully confusing, so here's the picture. Say:

   Hudson JVM
    +- cmd.exe
        +- ant JVM
            +- forked JUnit JVM

and if you tell Hudson to kill the build it will kill cmd.exe, which I
believe correctly kills ant JVM (or maybe it's not), but looking at your
error message, I suspect ant JVM is not killing the forked JUnit JVM.

Or can you use tools like "process explorer" and find out what Java
processes are left in there?

Oh, I just found [1], which seems to be relevant. Hmm. That makes me
wonder how process explorer is displaying a tree.

Do you know of any Windows tools that can kill the whole tree of a
process? If there's one that can be used from CLI, maybe I can hook that
up to Hudson so that it can kill the tree for Hudson.

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4770092
--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: java.exe is not killed

Martin Ankerl
> Do you know of any Windows tools that can kill the whole tree of a
> process? If there's one that can be used from CLI, maybe I can hook that
> up to Hudson so that it can kill the tree for Hudson.

Hm, I didnt know there was such a difference between windows' kill and
linux. After some googling this is the only thing I could find:
http://www.alexfedotov.com/articles/killproc.asp

--
Martin Ankerl | http://martin.ankerl.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java.exe is not killed

Jesse Glick
Martin Ankerl wrote:
> I didnt know there was such a difference between windows' kill and
> linux.

Unfortunately subprocess termination is not very portable, and not well
supported by Java. I did some research while fixing

http://www.netbeans.org/nonav/issues/show_bug.cgi?id=73162

for Unix, so links there may be helpful.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org
       http://google.com/search?q=e%5E%28pi*i%29%2B1

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java.exe is not killed

sakkew
In reply to this post by Martin Ankerl
I have the same problem on Windows when stopping a build. The
junit-task is alive and holds on test result files and jars.

For some reason I never got this issue using luntbuild. Might be that
they have a solution? 'svn co
https://luntbuild.svn.sourceforge.net/svnroot/luntbuild/trunk
luntbuild'


Sakke Wiik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java.exe is not killed

sakkew
In reply to this post by Kohsuke Kawaguchi-2
> Do you know of any Windows tools that can kill the whole tree of a
> process? If there's one that can be used from CLI, maybe I can hook that
> up to Hudson so that it can kill the tree for Hudson.
>
http://www.microsoft.com/technet/sysinternals/utilities/pskill.mspx


Sakke Wiik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java.exe is not killed

Kohsuke Kawaguchi-2
Sakke Wiik wrote:
>> Do you know of any Windows tools that can kill the whole tree of a
>> process? If there's one that can be used from CLI, maybe I can hook that
>> up to Hudson so that it can kill the tree for Hudson.
>>
> http://www.microsoft.com/technet/sysinternals/utilities/pskill.mspx

Thanks. Unfortunately this license does not allow redistribution, so we
can't use it in Hudson.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment