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

Main dashboard takes minutes to load in browser

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Since the upgrade to Jenkins 1.486 the main dashboard takes sometimes several minutes to load (> 5 minutes). In the log trail I found this exception:

      Oct 22, 2012 6:53:59 PM org.kohsuke.stapler.compression.CompressionFilter reportException
      WARNING: Untrapped servlet exception
      winstone.ClientSocketException: Failed to write to client
              at winstone.ClientOutputStream.write(ClientOutputStream.java:41)
              at winstone.WinstoneOutputStream.commit(WinstoneOutputStream.java:181)
              at winstone.WinstoneOutputStream.flush(WinstoneOutputStream.java:219)
              at winstone.WinstoneOutputStream.close(WinstoneOutputStream.java:229)
              at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:149)
              at org.kohsuke.stapler.compression.FilterServletOutputStream.close(FilterServletOutputStream.java:36)
              at java.io.FilterOutputStream.close(FilterOutputStream.java:143)
              at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:301)
              at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:130)
              at java.io.OutputStreamWriter.close(OutputStreamWriter.java:216)
              at java.io.BufferedWriter.close(BufferedWriter.java:248)
              at org.dom4j.io.XMLWriter.close(XMLWriter.java:286)
              at org.kohsuke.stapler.jelly.HTMLWriterOutput.close(HTMLWriterOutput.java:70)
              at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:56)
              at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:107)
              at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:127)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:625)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:488)
              at org.kohsuke.stapler.Stapler.service(Stapler.java:162)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
              at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
              at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
              at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
              at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:63)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
              at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
              at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
              at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:215)
              at winstone.RequestHandlerThread.run(RequestHandlerThread.java:138)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
              at java.util.concurrent.FutureTask.run(FutureTask.java:138)
              at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: java.net.SocketException: Broken pipe
              at java.net.SocketOutputStream.socketWrite0(Native Method)
              at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
              at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
              at winstone.ClientOutputStream.write(ClientOutputStream.java:39)
              ... 70 more
      

      When I directly go to a job page (by typing the job URL in the browser) I do not have any problem and the page is displayed immediately.

        Attachments

          Activity

          Hide
          leedega Kevin Phillips added a comment -

          Yes - this is correct. Everything else was kept consistent on the configuration during this change. The addition of a separate agent process on the same PC as the Jenkins master service to manage the job threads seems to have fixed the problem.

          Show
          leedega Kevin Phillips added a comment - Yes - this is correct. Everything else was kept consistent on the configuration during this change. The addition of a separate agent process on the same PC as the Jenkins master service to manage the job threads seems to have fixed the problem.
          Hide
          jglick Jesse Glick added a comment -

          AbstractStatusesColumn.getLastUnstableBuild as currently written is not suitable for use on Jenkins 1.485+. You must never attempt to iterate all builds in a job unless this is truly crucial for correctness and you are not running in an HTTP rendering thread. In some cases it makes sense to do a limited search, say going back ten or twenty builds at the most. However this is silly because there is already a Job.getLastUnstableBuild which is designed to operate efficiently (at least as of JENKINS-16023).

          Show
          jglick Jesse Glick added a comment - AbstractStatusesColumn.getLastUnstableBuild as currently written is not suitable for use on Jenkins 1.485+. You must never attempt to iterate all builds in a job unless this is truly crucial for correctness and you are not running in an HTTP rendering thread. In some cases it makes sense to do a limited search, say going back ten or twenty builds at the most. However this is silly because there is already a Job.getLastUnstableBuild which is designed to operate efficiently (at least as of JENKINS-16023 ).
          Hide
          jglick Jesse Glick added a comment -

          Assigning to the Compact Columns plugin. There may well be similar bugs in other plugins but they would better be filed separately.

          Show
          jglick Jesse Glick added a comment - Assigning to the Compact Columns plugin. There may well be similar bugs in other plugins but they would better be filed separately.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/com/robestone/hudson/compactcolumns/AbstractStatusesColumn.java
          http://jenkins-ci.org/commit/compact-columns-plugin/40af81d203ac0a3dd8cbeefe0f544fd1edc583d5
          Log:
          [FIXED JENKINS-15601] Use Job.getLastUnstableBuild, which is safe for 1.485+.
          Also in getLastAbortedBuild, limit the number of builds searched.

          Compare: https://github.com/jenkinsci/compact-columns-plugin/compare/15dff22c9bd3...40af81d203ac

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/com/robestone/hudson/compactcolumns/AbstractStatusesColumn.java http://jenkins-ci.org/commit/compact-columns-plugin/40af81d203ac0a3dd8cbeefe0f544fd1edc583d5 Log: [FIXED JENKINS-15601] Use Job.getLastUnstableBuild, which is safe for 1.485+. Also in getLastAbortedBuild, limit the number of builds searched. Compare: https://github.com/jenkinsci/compact-columns-plugin/compare/15dff22c9bd3...40af81d203ac
          Hide
          dankirkd Daniel Kirkdorffer added a comment - - edited

          Awesome! I saw this update and thought, "maybe this is what is causing our views to load so slowly," and applied the update and lo and behold!

          Thanks for the fix!

          Show
          dankirkd Daniel Kirkdorffer added a comment - - edited Awesome! I saw this update and thought, "maybe this is what is causing our views to load so slowly," and applied the update and lo and behold! Thanks for the fix!

            People

            • Assignee:
              jacob_robertson Jacob Robertson
              Reporter:
              sirot Jean-Christophe Sirot
            • Votes:
              18 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: