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

Jobs not dequeued when all executors are free

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • build-blocker-plugin
    • None
    • Jenkins: 2.7.1
      Build Blocker Plugin: 1.7.3

      Problem:

      I have two jobs that should not run in parallel.

      Job A runs when Job B is not running and vice versa.

      When no jobs are running and Job A queued (say when someone opens a PR) this job is always in the queue and not dequeued even though all the executors are free and no other job is running.

      This issue occurs when only this is the only job queued for execution in Jenkins. When a second job is queued, the first job starts executing. Seems like an issue with probing the queue.

      Workaround:
      The only effective workaround I could find was to have a dummy "hello world" job that runs every minute so that no jobs are always queued even though all executors are available and no conflicting jobs are running.

      Stacktrace:
      Oct 05, 2016 8:37:21 AM hudson.triggers.SafeTimerTask run
      SEVERE: Timer task hudson.model.Queue$MaintainTask@3d40ed96 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:1532)
      at hudson.model.Queue$MaintainTask.doRun(Queue.java:2722)
      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)

            Unassigned Unassigned
            puneeth_n Puneeth Nanjundaswamy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: