6
votes

I'm using Jenkins to build my projects on Maven 3. There is ~15 jobs defined. They are running onCommit or by cron expression all day long (mostly once per hour). Some jobs are using Sonar (XXXDailyBuild not).

Sometime I'm facing error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project xxx: Failed to clean project: Failed to delete E:\CI\data\jobs\XXXDailyBuild\workspace\XXX\xxx\target\surefire\surefirebooter8004371362793469171.jar -> [Help 1]

It is caused by locked Jenkins workspace by active java process of surefirebooter8004371362793469171.jar

Jenkins job runs with 'Execute concurrent builds if necessary' disabled. Any other job/process do not use 'XXXDailyBuild' workspace.

I'm trying to figure out what's going on. Is there any way to dump running 'surefirebooter8004371362793469171.jar' process to analyze their heap?

2
surefirebooterxxx.jar is used by maven to run some unit tests. The fact, that this jar is stil in use when an other build is started, indicates, that previous build not correcty terminated last time (may be has been interrupted).lweller

2 Answers

10
votes

Problem has been investigated:

  1. Our application runs JUnit tests by surefirebooter maven plugin jar
  2. Every tests need fresh models state
  3. During models initialization old models state are disposed and fresh are initialized Some models starts threads ie. Directory Watcher

The root PROBLEM is: 1. when some test fails in step 3. old models state aren't disposed and this way some threads aren't stopped (duplicated on every test fail)

It was easy to check it using jvisualvm tool.

Finally, after maven test run process stays active forever.

Hope this analysis help someone!

1
votes

Don't know the root cause and resolution. However, you can kill the java.exe from Task Manager (in Windows). This java.exe holds a lock on surefirebooter.jar file. Killing java.exe will Release that lock and you will be able to run the Maven Build.