Jenkins 2.7.4 seems to leave behind a Java TestNG process (on Windows slave) if the build is aborted/slave loses connection

13 views
Skip to first unread message

Greg Fraley

unread,
Oct 6, 2016, 12:11:10 PM10/6/16
to Jenkins Users
We have a build step that runs a TestNG suite, with the command looking something like this:

java -jar -Done-jar.main.class=org.testng.TestNG the-jar.jar TheTest.xml

 
If the process is aborted in any way (manual intervention, Jenkins build timeout, etc.) OR if the slave loses connection from the master long enough to fail the build, then there is a Java process left behind.

This is particularly damaging to us, as we load a DLL in the Java process, locking the file handle.  If we attempt the job again, we cannot load the DLL again, meaning that all future builds will fail without manual intervention (killing the leftover process manually).

Has anyone encountered a similar problem/have a workaround/have the ability to escalate a bug, if necessary?

Baptiste Mathus

unread,
Oct 9, 2016, 1:26:42 AM10/9/16
to jenkins...@googlegroups.com

We worked around a similar issue in the past with selenium with a job that would leave the webdriver process behind sometimes.
The idea for you is to find the right command for finding then killing processes under Windows (or do whatever cleanup is required).
Then just call that before or after each build.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/11c2dda4-ed02-43ba-966c-fddc7c8766f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Greg Fraley

unread,
Oct 9, 2016, 10:22:19 AM10/9/16
to Jenkins Users, m...@batmat.net
Thank you for the reply!  Unfortunately, we tried something similar, but killing a specific Java process is hard, especially when Jenkins itself is a Java process.  The only identifying information has to be accessed through the JVM, and the tools to do it are in the JDK, not the JRE, which would be a long and gruesome process to put on all our slaves.

I did end up filing a bug, and providing details on related issues, so here's to hoping that a fix can be coordinated.


On Sunday, October 9, 2016 at 1:26:42 AM UTC-4, Baptiste Mathus wrote:

We worked around a similar issue in the past with selenium with a job that would leave the webdriver process behind sometimes.
The idea for you is to find the right command for finding then killing processes under Windows (or do whatever cleanup is required).
Then just call that before or after each build.

Le 6 oct. 2016 6:11 PM, "Greg Fraley" <gsfr...@gmail.com> a écrit :
We have a build step that runs a TestNG suite, with the command looking something like this:

java -jar -Done-jar.main.class=org.testng.TestNG the-jar.jar TheTest.xml

 
If the process is aborted in any way (manual intervention, Jenkins build timeout, etc.) OR if the slave loses connection from the master long enough to fail the build, then there is a Java process left behind.

This is particularly damaging to us, as we load a DLL in the Java process, locking the file handle.  If we attempt the job again, we cannot load the DLL again, meaning that all future builds will fail without manual intervention (killing the leftover process manually).

Has anyone encountered a similar problem/have a workaround/have the ability to escalate a bug, if necessary?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages