Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49614

Function withMaven() fails after Maven process finished normally

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline-maven-plugin
    • None
    • Apache Jenkins CI, Windows NT slave

      Cyrille, I guess StephenC meant you on our Maven mailing list.

      So I assigned this issue to you.

      Within the function withMaven() I disabled all publishers because they were duplicated, maybe 100 identical reports. The function takes some time to continue after Maven run has finished and then suddenly tons of logs is printed saying that *** publisher is disabled, etc. In the logs the exception InterruptedException is thrown and then the logs continue.

       

      My main problem is this error:

      (a copy taken from the ASF mailing list)

       
      I have got BUILD SUCCESS of Maven run but the function withMaven() fails right after the Maven process has finished. I have no idea why.Because of this call in the stacktrace

      WithMavenStepExecution$WorkspaceCleanupCallback.finished

      I guess the function withMaven() is still doing something much later when cleanWs() finished.

      The principle looks like this:

      try {
         withMaven() {
      
         }
      
      } finally {
           cleanWs()
       }
      

      This is the stacktrace:

      [windows] [INFO] BUILD SUCCESS
       [windows] [INFO] ------------------------------------------------------------------------
       [windows] [INFO] Total time: 43:08 min
       [windows] [INFO] Finished at: 2018-02-18T04:34:10+00:00
       [windows] [INFO] Final Memory: 48M/161M
       [windows] [INFO] ------------------------------------------------------------------------
       [windows] [INFO] [jenkins-event-spy] Generated F:\jenkins\jenkins-slave\workspace\n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp\withMavene898fc1f\maven-spy-20180218-035101-1877982869374894449694.log
       [windows] Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="f:\jenkins\jenkins-slave\workspace\n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp\withMavene898fc1f\pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="f:\jenkins\jenkins-slave\workspace\n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp\withMavene898fc1f" 
       [Pipeline] [windows] }
       [windows] ERROR: [withMaven] WARNING Exception processing the logs generated by the Jenkins Maven Event Spy f:\jenkins\jenkins-slave\workspace\n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp\withMavene898fc1f\maven-spy-20180218-042026-3958838718902276550716.log, ignore file.  Please report a bug associated for the component 'pipeline-maven-plugin' at https://issues.jenkins-ci.org 
       [windows] java.lang.InterruptedException
       [windows]     at java.lang.Object.wait(Native Method)
       [windows]     at hudson.remoting.Request.call(Request.java:167)
       [windows]     at hudson.remoting.Channel.call(Channel.java:907)
       [windows]     at hudson.FilePath.act(FilePath.java:986)
       [windows]     at hudson.FilePath.act(FilePath.java:975)
       [windows]     at hudson.FilePath.exists(FilePath.java:1440)
       [windows]     at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:105)
       [windows]     at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:1015)
       [windows]     at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
       [windows]     at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:368)
       [windows]     at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
       [windows]     at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:166)
       [windows]     at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
       [windows]     at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
       [windows]     at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
       [windows]     at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
       [windows]     at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
       [windows]     at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
       [windows]     at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
       [windows]     at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
       [windows]     at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
       [windows]     at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
       [windows]     at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:331)
       [windows]     at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:82)
       [windows]     at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:243)
       [windows]     at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:231)
       [windows]     at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
       [windows]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       [windows]     at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
       [windows]     at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
       [windows]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       [windows]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       [windows]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       [windows]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       [windows]     at java.lang.Thread.run(Thread.java:748)
        

          [JENKINS-49614] Function withMaven() fails after Maven process finished normally

          Tibor Digana added a comment -

          The thing is that the Maven build process, run in the function withMaven(), runs several modules and one of them forks sub-processes which are also Maven native processes. These sub-processes succeed and some just fail which is also expected scenario.

          I found that one of them sends this text over the Standard Outputstream Std/Out:

          Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/home/jenkins/jenkins-slave/workspace/n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp/withMavenba69d9b6/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/home/jenkins/jenkins-slave/workspace/n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp/withMavenba69d9b6"

          This is maybe interesting for you.

          Altogether the last module forks 750 sub-processes and waiting until all have finished.

          Not sure what you do with our Maven run.

          It looks to me a kind of proxy around them.

          Additionally we have tests which are expected to call a native library which should cause segfault and this text comes from the stream out.

           

          It looks to me that all the analysis goes through all the integration tests unexpectedly.

          If the function openTasksPublisher() was enabled, I could not read Jenkins page because of 100 identical reports. So I disabled it, but I can see that all 5 publishers print "skipping..." with tons of logs and maybe there is the cause of InterruptedException.

           

          Tibor Digana added a comment - The thing is that the Maven build process, run in the function withMaven(), runs several modules and one of them forks sub-processes which are also Maven native processes. These sub-processes succeed and some just fail which is also expected scenario. I found that one of them sends this text over the Standard Outputstream Std/Out: Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/home/jenkins/jenkins-slave/workspace/n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp/withMavenba69d9b6/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/home/jenkins/jenkins-slave/workspace/n-wip_maven-surefire_master-VMXNEFVLKSG4Y4Q25OS6RZDPHGE56CJURNETLF6TR2V5RXK7KNVQ@tmp/withMavenba69d9b6" This is maybe interesting for you. Altogether the last module forks 750 sub-processes and waiting until all have finished. Not sure what you do with our Maven run. It looks to me a kind of proxy around them. Additionally we have tests which are expected to call a native library which should cause segfault and this text comes from the stream out.   It looks to me that all the analysis goes through all the integration tests unexpectedly. If the function openTasksPublisher() was enabled, I could not read Jenkins page because of 100 identical reports. So I disabled it, but I can see that all 5 publishers print "skipping..." with tons of logs and maybe there is the cause of InterruptedException .  

          tibor17 , see the latest Maven parent pom. I added an env variable to surefire or invoker that turns off withMaven in the child process. You want withMaven on the outermost Maven, but not on any inner ones.

          Stephen Connolly added a comment - tibor17 , see the latest Maven parent pom. I added an env variable to surefire or invoker that turns off withMaven in the child process. You want withMaven on the outermost Maven, but not on any inner ones.

          JENKINS_MAVEN_AGENT_DISABLED in https://github.com/apache/maven-parent/commit/9c3213c8a5aa7441bc1e79376d3a3b901eaca2a2

          If you are not on the latest parent you could add this change locally until after the surefire release

          Stephen Connolly added a comment - JENKINS_MAVEN_AGENT_DISABLED in https://github.com/apache/maven-parent/commit/9c3213c8a5aa7441bc1e79376d3a3b901eaca2a2 If you are not on the latest parent you could add this change locally until after the surefire release

          Tibor Digana added a comment -

          stephenconnolly

          Thx Stephen for a hint. I will take over in Surefire project tomorrow. We are working on a release and this would be part of little improvements.

          Tibor Digana added a comment - stephenconnolly Thx Stephen for a hint. I will take over in Surefire project tomorrow. We are working on a release and this would be part of little improvements.

          benoit guerin added a comment - - edited

          I think this is a dupe of JENKINS-49337

          benoit guerin added a comment - - edited I think this is a dupe of  JENKINS-49337

          Fixed in pipeline-maven-plugin 3.6.5

          Cyrille Le Clerc added a comment - Fixed in pipeline-maven-plugin 3.6.5

            cleclerc Cyrille Le Clerc
            tibor17 Tibor Digana
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: