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

Make the lifetime of queue items cache configurable

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      jenkins-1.509.3
    • Similar Issues:

      Description

      In the Jenkins installations with many executors queue becomes a critical resource. When many executors / scheduler try to take the job at the same time, queue visualization may lock the web interface:

      "Handling POST /ajaxBuildQueue : RequestHandlerThread180" daemon prio=10 tid=0x00002aaacccdc000 nid=0x378c waiting for monitor entry [0x0000000059b2c000]
      java.lang.Thread.State: BLOCKED (on object monitor)
      at hudson.model.Queue.getItems(Queue.java:641)

      • waiting to lock <0x0000000680060bf0> (a hudson.model.Queue)
        at hudson.model.Queue$CachedItemList.get(Queue.java:196)
        at hudson.model.Queue.getApproximateItemsQuickly(Queue.java:671)
        at hudson.model.View.getApproximateQueueItemsQuickly(View.java:457)
        at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)

      getApproximateItemsQuickly() updates its cache every 1 second. I propose to make this time configurable

        Attachments

          Issue Links

            Activity

            Show
            oleg_nenashev Oleg Nenashev added a comment - https://github.com/jenkinsci/jenkins/pull/1221
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/Queue.java
            http://jenkins-ci.org/commit/jenkins/0d825984ff7460f988b0a272a33dc60acc30e415
            Log:
            [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option

            The option allows to manage the refresh period of the internal queue cache.

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Queue.java http://jenkins-ci.org/commit/jenkins/0d825984ff7460f988b0a272a33dc60acc30e415 Log: [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option The option allows to manage the refresh period of the internal queue cache. Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            core/src/main/java/hudson/model/Queue.java
            http://jenkins-ci.org/commit/jenkins/8175eecc7a3eeedef8e3a7230e2bc8680423a1ba
            Log:
            Merge pull request #1221 from synopsys-arc-oss/configurable_queue_cache_refresh

            [READY] [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/model/Queue.java http://jenkins-ci.org/commit/jenkins/8175eecc7a3eeedef8e3a7230e2bc8680423a1ba Log: Merge pull request #1221 from synopsys-arc-oss/configurable_queue_cache_refresh [READY] [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3615
            [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option (Revision 0d825984ff7460f988b0a272a33dc60acc30e415)

            Result = SUCCESS
            o.v.nenashev : 0d825984ff7460f988b0a272a33dc60acc30e415
            Files :

            • core/src/main/java/hudson/model/Queue.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3615 [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option (Revision 0d825984ff7460f988b0a272a33dc60acc30e415) Result = SUCCESS o.v.nenashev : 0d825984ff7460f988b0a272a33dc60acc30e415 Files : core/src/main/java/hudson/model/Queue.java
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/Queue.java
            http://jenkins-ci.org/commit/jenkins/227b73e081d5063895ba1a7438a99a5989f275ae
            Log:
            [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option

            The option allows to manage the refresh period of the internal queue cache.

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
            (cherry picked from commit 0d825984ff7460f988b0a272a33dc60acc30e415)
            (cherry picked from commit 05cb8b2ec6b7e7ca688cfbcf4711bb2d14950eff)

            Compare: https://github.com/jenkinsci/jenkins/compare/0e6f09c402e8^...227b73e081d5

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Queue.java http://jenkins-ci.org/commit/jenkins/227b73e081d5063895ba1a7438a99a5989f275ae Log: [FIXED JENKINS-19691] - Added the hudson.model.Queue.cacheRefreshPeriod option The option allows to manage the refresh period of the internal queue cache. Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com> (cherry picked from commit 0d825984ff7460f988b0a272a33dc60acc30e415) (cherry picked from commit 05cb8b2ec6b7e7ca688cfbcf4711bb2d14950eff) Compare: https://github.com/jenkinsci/jenkins/compare/0e6f09c402e8 ^...227b73e081d5

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: