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

Gerrit Triggers stop triggering builds and the queue builds up

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • gerrit-trigger-plugin
    • None
    • CloudBees CI 2.222.2.1
      Gerrit Trigger Plugin 2.30.5

      1. Summary: 
        1. Gerrit triggers will at some point stop triggering builds in Jenkins. The queue can be seen to grow out of control and is visible as such inside Jenkins. The only current workaround has been to restart the master to get the queue flowing again. This issue has popped up in the effected master twice over a month.
      1. Steps to reproduce
        1. The exact cause is not known yet. 
        2. This is following the Gerrit Trigger Plugin being upgraded from version 2.27.1 to version 2.30.5.
        3. This also followed the Jenkins server being upgraded from a 1.x version to a 2.x version.
      2. Expected behavior. 
        1. The Gerrit Trigger queue will not start to back up and will continue executing builds.
      3. Actual behavior
        1. The Gerrit queue begins to build.
        2. No builds are started from Gerrit Triggers.

      The log messages do indicate that the queue has stopped processing:

      2020-05-07 21:35:57.166+0000 [id=1253] WARNING c.s.t.g.g.GerritHandler#checkQueueSize: The Gerrit incoming events queue contains 247 items! Something might be stuck, or your system can't process the commands fast enough. Try to increase the number of receiving worker threads. Current thread-pool size: 4
      

      Increasing the number of worker threads has no impact on this issue. As observed, the queue size reported will continue to grow until the master is restarted.

      A thread dump was captured when this issue was happening. There were four Gerrit threads sitting in a WAITING state while the queue was growing:

      "Gerrit Worker EventThread_28" id=691286 (0xa8c56) state=WAITING cpu=95%
          - waiting on <0x66dc3d20> (a java.util.concurrent.CountDownLatch$Sync)
          - locked <0x66dc3d20> (a java.util.concurrent.CountDownLatch$Sync)
          at sun.misc.Unsafe.park(Native Method)
          at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
          at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
          at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
          at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
          at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
          at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger.waitForProjectListToBeReady(GerritTrigger.java:1876)
          at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.gerritEvent(EventListener.java:188)
          at sun.reflect.GeneratedMethodAccessor607.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListener(GerritHandler.java:496)
          at com.sonymobile.tools.gerrit.gerritevents.GerritHandler.notifyListeners(GerritHandler.java:476)
          at com.sonyericsson.hudson.plugins.gerrit.trigger.JenkinsAwareGerritHandler.notifyListeners(JenkinsAwareGerritHandler.java:80)
          at com.sonymobile.tools.gerrit.gerritevents.workers.AbstractGerritEventWork.perform(AbstractGerritEventWork.java:46)
          at com.sonymobile.tools.gerrit.gerritevents.workers.AbstractJsonObjectWork.perform(AbstractJsonObjectWork.java:77)
          at com.sonymobile.tools.gerrit.gerritevents.workers.StreamEventsStringWork.perform(StreamEventsStringWork.java:67)
          at com.sonymobile.tools.gerrit.gerritevents.GerritHandler$EventWorker.run(GerritHandler.java:302)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      

      We also see these Gerrit threads:

      "com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater for review-tbs Thread" id=37 (0x25) state=TIMED_WAITING cpu=63%
          - waiting on <0x0b482201> (a com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater)
          - locked <0x0b482201> (a com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater)
          at java.lang.Object.wait(Native Method)
          at com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater.waitFor(GerritProjectListUpdater.java:212)
          at com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater.run(GerritProjectListUpdater.java:169)
      
      "com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater for review-tbs-dev Thread" id=38 (0x26) state=TIMED_WAITING cpu=63%
          - waiting on <0x2e1418f7> (a com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater)
          - locked <0x2e1418f7> (a com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater)
          at java.lang.Object.wait(Native Method)
          at com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater.waitFor(GerritProjectListUpdater.java:212)
          at com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater.run(GerritProjectListUpdater.java:169)
      

      Attached full thread dump

      1. Workaround. 
        1. **Restart the effected Master.
      2. Business impact. 
        1. **No Gerrit builds are triggered and the master must be restarted to resolve the problem.

        1. configDiff.png
          configDiff.png
          41 kB
        2. CustomTracesAwait.png
          CustomTracesAwait.png
          8 kB
        3. thread-dump.txt
          373 kB

            rsandell rsandell
            mmclaughlin Mitch McLaughlin
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: