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

ajaxExecutors/ajaxBuildQueue posted even when pane is collapsed

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • core

      Normally Jenkins will post to ajaxBuildQueue and ajaxExecutors every few seconds to refresh these widgets. If you click the - button to collapse them, the results are not displayed...but the web requests are still sent, putting load on the master! We should just skip the refresh on a collapsed pane.

      Note that toggling the collapsed state involves a page refresh, so there is no risk of missing updates if you click + to expand.

          [JENKINS-62129] ajaxExecutors/ajaxBuildQueue posted even when pane is collapsed

          Jesse Glick added a comment -

          I was trying

          diff --git core/src/main/resources/lib/hudson/executors.jelly core/src/main/resources/lib/hudson/executors.jelly
          index 4cd01bcadd..62eb9d3276 100644
          --- core/src/main/resources/lib/hudson/executors.jelly
          +++ core/src/main/resources/lib/hudson/executors.jelly
          @@ -155,7 +155,7 @@ THE SOFTWARE.
                 </j:forEach>
               </l:pane>
               <!-- schedule updates only for the full page reload -->
          -    <j:if test="${ajax==null and h.hasPermission(app.READ)}">
          +    <j:if test="${ajax==null and h.hasPermission(app.READ) and not h.isCollapsed('executors')}">
                 <script defer="defer">
                   refreshPart('executors',"${rootURL}/${h.hasView(it,'ajaxExecutors')?it.url:''}ajaxExecutors");
                 </script>
          diff --git core/src/main/resources/lib/hudson/queue.jelly core/src/main/resources/lib/hudson/queue.jelly
          index 776c4ed46a..93b6eb5560 100644
          --- core/src/main/resources/lib/hudson/queue.jelly
          +++ core/src/main/resources/lib/hudson/queue.jelly
          @@ -101,7 +101,7 @@ THE SOFTWARE.
               </j:choose>
             </l:pane>
             <!-- schedule updates only for the full page reload -->
          -  <j:if test="${ajax==null and h.hasPermission(app.READ)}">
          +  <j:if test="${ajax==null and h.hasPermission(app.READ) and not h.isCollapsed('buildQueue')}">
               <script defer="defer">
                 refreshPart('buildQueue',"${rootURL}/${h.hasView(it,'ajaxBuildQueue')?it.url:''}ajaxBuildQueue");
               </script>
          

          until I realized that the original feature included dynamic updates to the pane titles, which still require HTTP requests to the master. Perhaps those should be dropped, to minimize load, but this would be a minor functional regression. And a three-way toggle (full, minimized, nonrefreshing) seems too awkward. The best we could do is slow down the refresh to, say, once per minute when minimized? Or use a lighter-weight REST call that does not involve rendering HTML?

          Jesse Glick added a comment - I was trying diff --git core/src/main/resources/lib/hudson/executors.jelly core/src/main/resources/lib/hudson/executors.jelly index 4cd01bcadd..62eb9d3276 100644 --- core/src/main/resources/lib/hudson/executors.jelly +++ core/src/main/resources/lib/hudson/executors.jelly @@ -155,7 +155,7 @@ THE SOFTWARE. </j:forEach> </l:pane> <!-- schedule updates only for the full page reload --> - <j:if test= "${ajax==null and h.hasPermission(app.READ)}" > + <j:if test= "${ajax==null and h.hasPermission(app.READ) and not h.isCollapsed( 'executors' )}" > <script defer= "defer" > refreshPart( 'executors' , "${rootURL}/${h.hasView(it, 'ajaxExecutors' )?it.url:''}ajaxExecutors" ); </script> diff --git core/src/main/resources/lib/hudson/queue.jelly core/src/main/resources/lib/hudson/queue.jelly index 776c4ed46a..93b6eb5560 100644 --- core/src/main/resources/lib/hudson/queue.jelly +++ core/src/main/resources/lib/hudson/queue.jelly @@ -101,7 +101,7 @@ THE SOFTWARE. </j:choose> </l:pane> <!-- schedule updates only for the full page reload --> - <j:if test= "${ajax==null and h.hasPermission(app.READ)}" > + <j:if test= "${ajax==null and h.hasPermission(app.READ) and not h.isCollapsed( 'buildQueue' )}" > <script defer= "defer" > refreshPart( 'buildQueue' , "${rootURL}/${h.hasView(it, 'ajaxBuildQueue' )?it.url:''}ajaxBuildQueue" ); </script> until I realized that the original feature included dynamic updates to the pane titles, which still require HTTP requests to the master. Perhaps those should be dropped, to minimize load, but this would be a minor functional regression. And a three-way toggle (full, minimized, nonrefreshing) seems too awkward. The best we could do is slow down the refresh to, say, once per minute when minimized? Or use a lighter-weight REST call that does not involve rendering HTML?

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: