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

Build-Blocker-Plugin blocks on builds queued leading to deadlock

      Assume two projects that never shall be build in parallel. You may build project A, then project B or vice versa, but never project A and B together.
      In Project A you define project B as blocker.
      In Project B you define project A as blocker.

      All will be fine:
      Project A builds, Project B is blocked.
      Project B builds, Project A is blocked.

      ... until when Project A is queued, because no available slots to build, and then Project B is queued to. Now Project A blocks Project B, while Project B blocks Project A. Both will never be build! Cause:
      "Build-Blocker-Plugin" does not only take running projects in to account to block other projects, it takes the queue too! This leads to deadlocks as soon as both projects are queued. The plugin should only take running projects into account blocking other projects.

          [JENKINS-28513] Build-Blocker-Plugin blocks on builds queued leading to deadlock

          Lars Vateman added a comment -

          1.618 did resolve the problem for me. Jobs are being blocked and released as they should again

          Lars Vateman added a comment - 1.618 did resolve the problem for me. Jobs are being blocked and released as they should again

          Daniel Beck added a comment -

          Resolving as duplicate of JENKINS-28926 (which looks like the best candidate for this) after comments indicating this is fixed in 1.618.

          Daniel Beck added a comment - Resolving as duplicate of JENKINS-28926 (which looks like the best candidate for this) after comments indicating this is fixed in 1.618.

          Seems to work again since 1.618

          Thomas Schweikle added a comment - Seems to work again since 1.618

          I have this issue with 1.654

          Queue is full, all nodes idling.

          Timer task hudson.model.Queue$MaintainTask@75b41624 failed
          java.lang.NullPointerException
          	at hudson.plugins.buildblocker.BlockingJobsMonitor.checkNodeForQueueEntries(BlockingJobsMonitor.java:108)
          	at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkAccordingToProperties(BuildBlockerQueueTaskDispatcher.java:171)
          	at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkForBlock(BuildBlockerQueueTaskDispatcher.java:127)
          	at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:110)
          	at hudson.model.Queue$JobOffer.canTake(Queue.java:260)
          	at hudson.model.Queue.maintain(Queue.java:1529)
          	at hudson.model.Queue$MaintainTask.doRun(Queue.java:2719)
          	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
          	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
          	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
          	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          	at java.lang.Thread.run(Thread.java:745)
          
          

          Felix Sperling added a comment - I have this issue with 1.654 Queue is full, all nodes idling. Timer task hudson.model.Queue$MaintainTask@75b41624 failed java.lang.NullPointerException at hudson.plugins.buildblocker.BlockingJobsMonitor.checkNodeForQueueEntries(BlockingJobsMonitor.java:108) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkAccordingToProperties(BuildBlockerQueueTaskDispatcher.java:171) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkForBlock(BuildBlockerQueueTaskDispatcher.java:127) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:110) at hudson.model.Queue$JobOffer.canTake(Queue.java:260) at hudson.model.Queue.maintain(Queue.java:1529) at hudson.model.Queue$MaintainTask.doRun(Queue.java:2719) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang. Thread .run( Thread .java:745)

          Felix Sperling added a comment - - edited

          Problem is appearing in v1.654
          Seems like 1.651.1 and 1.651.2 are also affected.

          Felix Sperling added a comment - - edited Problem is appearing in v1.654 Seems like 1.651.1 and 1.651.2 are also affected.

          Any update on this? :/

          Jenkins: 2.7.1
          Build Blocker Plugin: 1.7.3

          Puneeth Nanjundaswamy added a comment - Any update on this? :/ Jenkins: 2.7.1 Build Blocker Plugin: 1.7.3

          malavika chintapanti added a comment - - edited

          I am also facing same issue. version of plugin-1.7.3 , Jenkins-2.19.3
          Setting: block on node level = true
          check buildable queued builds = true
          Blocking Jobs = .*
          Two jobs keep blocking each other if these are queued.
          There should be some way it resolves automatically.

          malavika chintapanti added a comment - - edited I am also facing same issue. version of plugin-1.7.3 , Jenkins-2.19.3 Setting: block on node level = true check buildable queued builds = true Blocking Jobs = .* Two jobs keep blocking each other if these are queued. There should be some way it resolves automatically.

          Asaf M added a comment -

          Happens to me as well:

          Jan 05, 2017 9:12:17 AM hudson.triggers.SafeTimerTask run
          SEVERE: Timer task hudson.model.Queue$MaintainTask@63703c8 failed
          java.lang.NullPointerException
                  at hudson.plugins.buildblocker.BlockingJobsMonitor.checkNodeForQueueEntries(BlockingJobsMonitor.java:108)
                  at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkAccordingToProperties(BuildBlockerQueueTaskDispatcher.java:171)
                  at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkForBlock(BuildBlockerQueueTaskDispatcher.java:127)
                  at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:110)
                  at hudson.model.Queue$JobOffer.canTake(Queue.java:258)
                  at hudson.model.Queue.maintain(Queue.java:1519)
                  at hudson.model.Queue$MaintainTask.doRun(Queue.java:2709)
                  at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
                  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                  at java.lang.Thread.run(Thread.java:745)
          

          Jenkins version 2.15

          Asaf M added a comment - Happens to me as well: Jan 05, 2017 9:12:17 AM hudson.triggers.SafeTimerTask run SEVERE: Timer task hudson.model.Queue$MaintainTask@63703c8 failed java.lang.NullPointerException at hudson.plugins.buildblocker.BlockingJobsMonitor.checkNodeForQueueEntries(BlockingJobsMonitor.java:108) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkAccordingToProperties(BuildBlockerQueueTaskDispatcher.java:171) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.checkForBlock(BuildBlockerQueueTaskDispatcher.java:127) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:110) at hudson.model.Queue$JobOffer.canTake(Queue.java:258) at hudson.model.Queue.maintain(Queue.java:1519) at hudson.model.Queue$MaintainTask.doRun(Queue.java:2709) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang. Thread .run( Thread .java:745) Jenkins version 2.15

          Oleg Nenashev added a comment -

          https://github.com/jenkinsci/build-blocker-plugin/pull/9 is an attempt to fix that, but AFAIK there is no active maintainer

          Oleg Nenashev added a comment - https://github.com/jenkinsci/build-blocker-plugin/pull/9 is an attempt to fix that, but AFAIK there is no active maintainer

          Denis Mone added a comment -

          The pull request has been merged and released on version 1.7.5 of the plugin.
          Please verify that the fix covers your use case.

          Denis Mone added a comment - The pull request has been merged and released on version 1.7.5 of the plugin. Please verify that the fix covers your use case.

            dmone Denis Mone
            tps800 Thomas Schweikle
            Votes:
            14 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: