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

High lock contention in Queue causes builds to not trigger

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • github-branch-source-2.10.3

      We upgraded to 2.283 of Jenkins from ~2.279 3 weeks ago.

      Since the last 1-2 weeks we've noticed builds often not being triggered when they should be, if you click 'Build now' then it flashes for a second but no job starts.

      The job does start eventually I believe but minutes later.

      Attached results from 'collectPerformanceData.sh' in https://support.cloudbees.com/hc/en-us/articles/229795948-Required-Data-CJP-CJT-Hang-Issue-On-Linux

      Note most of the tools the script wants isn't installed as its running in a docker container.
      I ran thread dumps every 5 seconds for 3 minutes

      you can see mostly of the relevant info with

      tar -xzf performanceData.7.output.tar.gz
      cd threads
      grep -A 10 -B 10 hudson.model.Queue.withLock *
      

      I'm not sure exactly what I'm looking for but here's an excerpt

      threads.7.20210330084345.txt-"Executor #-1 for master" #334602 daemon prio=5 os_prio=0 cpu=0.09ms elapsed=13.88s tid=0x00007f9e04604000 nid=0x5713 waiting on condition  [0x00007f9d4717f000]
      threads.7.20210330084345.txt-   java.lang.Thread.State: WAITING (parking)
      threads.7.20210330084345.txt-	at jdk.internal.misc.Unsafe.park(java.base@11.0.10/Native Method)
      threads.7.20210330084345.txt-	- parking to wait for  <0x000000046cdf2d10> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
      threads.7.20210330084345.txt-	at java.util.concurrent.locks.LockSupport.park(java.base@11.0.10/LockSupport.java:194)
      threads.7.20210330084345.txt-	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(java.base@11.0.10/AbstractQueuedSynchronizer.java:885)
      threads.7.20210330084345.txt-	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(java.base@11.0.10/AbstractQueuedSynchronizer.java:917)
      threads.7.20210330084345.txt-	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@11.0.10/AbstractQueuedSynchronizer.java:1240)
      threads.7.20210330084345.txt-	at java.util.concurrent.locks.ReentrantLock.lock(java.base@11.0.10/ReentrantLock.java:267)
      threads.7.20210330084345.txt-	at hudson.model.Queue._withLock(Queue.java:1444)
      threads.7.20210330084345.txt:	at hudson.model.Queue.withLock(Queue.java:1304)
      threads.7.20210330084345.txt-	at hudson.model.Executor.run(Executor.java:347)
      threads.7.20210330084345.txt-
      threads.7.20210330084345.txt-   Locked ownable synchronizers:
      threads.7.20210330084345.txt-	- None
      threads.7.20210330084345.txt-
      threads.7.20210330084345.txt-"org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep [#19471]" #334603 daemon prio=5 os_prio=0 cpu=0.24ms elapsed=13.45s tid=0x00007f9ebc658000 nid=0x5714 waiting on condition  [0x00007f9ded3da000]
      threads.7.20210330084345.txt-   java.lang.Thread.State: TIMED_WAITING (parking)
      threads.7.20210330084345.txt-	at jdk.internal.misc.Unsafe.park(java.base@11.0.10/Native Method)
      threads.7.20210330084345.txt-	- parking to wait for  <0x0000000477c00dc8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      threads.7.20210330084345.txt-	at java.util.concurrent.locks.LockSupport.parkNanos(java.base@11.0.10/LockSupport.java:234)
      

            Unassigned Unassigned
            timja Tim Jacomb
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: