Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven surefirebooter

Tags:

maven

jenkins

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?

like image 882
Paweł Dulęba Avatar asked Jul 04 '13 08:07

Paweł Dulęba


2 Answers

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!

like image 200
Paweł Dulęba Avatar answered Sep 21 '22 00:09

Paweł Dulęba


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.

like image 44
Sameer Patel Avatar answered Sep 18 '22 00:09

Sameer Patel