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

Jobs hanging in Build Executor even if it is finished

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • core

      Since a couple of days (since updating to 1.609.3 LTS) we have the problem that is the builds stick in the bild executor.If you open the build details the build is finished allready. But the executor is still blocked leading to a Build-queue that is constantly growing. Sometime the executor will display "DEAD " (German: "Tot "). There are no specific entries in the log file.

      Master is running on a virtual Windows Server 2012. Slaves are Windoes Server 2012 and Windows 7.

        1. jenkins-plugins.txt
          3 kB
        2. jenkins_dump.txt
          451 kB
        3. Thread Dump [Jenkins].pdf
          288 kB
        4. BuildExecutors.png
          BuildExecutors.png
          80 kB

          [JENKINS-31536] Jobs hanging in Build Executor even if it is finished

          Stefan Herrmann created issue -

          Stefan Herrmann added a comment - - edited

          I found a workaround. After looking at the thread dump it seemd that threads where waiting for a jenkins.util.timer thread. After killing those threads work continued as normal.

          Stefan Herrmann added a comment - - edited I found a workaround. After looking at the thread dump it seemd that threads where waiting for a jenkins.util.timer thread. After killing those threads work continued as normal.

          The problem still exists. I have tried to evaluete it a bit further:

          • the problem only arises if there are a couple of jobs in the build queue (e.g. > 100)
          • The Executors in the build processor status shows jobs as "in progress". But if you go on the job details it is already finished. Some time later the executor is marked as dead.
          • Build queue is constantly filling, because jobs are executed very slowely
          • CPU usage on master grows until it is running with 90 to 100% CPU usage
          • ThreadDump shows an "AtmostOneTaskExecutor" that is waiting on "java.util.concurrent.locks.ReentrantLock$NonfairSync" owned by "jenkins.util.Timer x".
          • The Timer threads are waiting
          • If i kill the timer threads and the "AtmostOneTaskExecutor" work goes on. But this can not be a final solution.

          Stefan Herrmann added a comment - The problem still exists. I have tried to evaluete it a bit further: the problem only arises if there are a couple of jobs in the build queue (e.g. > 100) The Executors in the build processor status shows jobs as "in progress". But if you go on the job details it is already finished. Some time later the executor is marked as dead. Build queue is constantly filling, because jobs are executed very slowely CPU usage on master grows until it is running with 90 to 100% CPU usage ThreadDump shows an "AtmostOneTaskExecutor" that is waiting on "java.util.concurrent.locks.ReentrantLock$NonfairSync" owned by "jenkins.util.Timer x ". The Timer threads are waiting If i kill the timer threads and the "AtmostOneTaskExecutor" work goes on. But this can not be a final solution.
          Stefan Herrmann made changes -
          Labels New: deadlock executor

          Added ThreadDump

          Stefan Herrmann added a comment - Added ThreadDump
          Stefan Herrmann made changes -
          Attachment New: Thread Dump [Jenkins].pdf [ 31323 ]

          Daniel Beck added a comment -

          stephenconnolly Any idea what's going on here? Possibly related to your recent queue work?

          Daniel Beck added a comment - stephenconnolly Any idea what's going on here? Possibly related to your recent queue work?

          Are there any ideas what causes this behaviour. We have a fairly large Jenkins architecture with over 4000 CI Jobs and i had to disable a whole bunch of them in order to prevent the server from failing all the time.

          Stefan Herrmann added a comment - Are there any ideas what causes this behaviour. We have a fairly large Jenkins architecture with over 4000 CI Jobs and i had to disable a whole bunch of them in order to prevent the server from failing all the time.

          Al Shepherd added a comment -

          I don't know if this helps any, but we have experienced this issue when running scheduled master jobs.

          Details: we have a master job that is scheduled to run at 1am every day. This master job invokes other jobs via Conditional step (single) entries in the Build section. When a conditional step triggers a job that has the Warning plug-in configured for it (let's call it job 2), the triggered job (job 2)completes successfully but then control is never returned to the calling (master) job. When the plug-in configuration is removed from job 2 everything runs as it should. If we replace the Warnings plug-in job 2 then trigger a build of this job manually (not via the master job), the plug-in works as advertised (beautifully done by the way). Also, if we set up job 2 as a scheduled job and let it fire off via this trigger the Warnings plug-in behaves as it should.

          Al Shepherd added a comment - I don't know if this helps any, but we have experienced this issue when running scheduled master jobs. Details: we have a master job that is scheduled to run at 1am every day. This master job invokes other jobs via Conditional step (single) entries in the Build section. When a conditional step triggers a job that has the Warning plug-in configured for it (let's call it job 2), the triggered job (job 2)completes successfully but then control is never returned to the calling (master) job. When the plug-in configuration is removed from job 2 everything runs as it should. If we replace the Warnings plug-in job 2 then trigger a build of this job manually (not via the master job), the plug-in works as advertised (beautifully done by the way). Also, if we set up job 2 as a scheduled job and let it fire off via this trigger the Warnings plug-in behaves as it should.

          Daniel Beck added a comment -

          I find the Node Stalker Plugin in the stack trace of the thread everyone else is waiting for very suspicious. What happens when you disable the plugin, or disable its features (if it offers such options)?

          Daniel Beck added a comment - I find the Node Stalker Plugin in the stack trace of the thread everyone else is waiting for very suspicious. What happens when you disable the plugin, or disable its features (if it offers such options)?

            Unassigned Unassigned
            herrmann81 Stefan Herrmann
            Votes:
            6 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: