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

BlueOcean plugin stops being usable when number of nodes in a pipeline passes 20

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.235.5
      BlueOcean 1.23.2
    • Similar Issues:

      Description

      Here's a pipeline I'm comfortable sharing. It cleans up the old folders in Jenkins workspace across all online nodes.

      When the number of nodes passes 15-20, the BlueOcean view gets stuck. Fans kick in. This quickly gets Safari/Chrome/Firefox to get stuck in our environment.

      The above is correct even for the jobs that have completely finished quite a while ago.

      def builders = [:].asSynchronized()
      
      node('master') {
          stage('Pre-flight') {
              String[] node_names = []
      
              for (Node node in Hudson.instance.nodes) {
                  if (node != null && node.toComputer() != null && node.toComputer().online) {
                    node_names += node.getNodeName() 
                  }
                  node = null
              }
      
              for (node_name in node_names) {
                  def final_node_name = node_name
                  
                  builders[final_node_name] = {
                      node(final_node_name) {
                          timeout(time:5, unit: "MINUTES") {
                              def usage = ''
                              usage = sh(script: "df -h / | tail -n 1 | awk '{print \$5}'", returnStdout: true).trim()
                              println "usage before: ${usage}"
                          
                              sh """#!/bin/bash -x
                              touch ${WORKSPACE}/.dont_remove_workspace
                              sudo find ${WORKSPACE}/.. -mindepth 1 -maxdepth 1 -type d -mmin +180 -print -exec sudo rm -rf {} \\;
                              rm -f ${WORKSPACE}/.dont_remove_workspace
                              """
                              usage = sh(script: "df -h / | tail -n 1 | awk '{print \$5}'", returnStdout: true).trim()
                              println "usage after: ${usage}"
                          }
                      }
                  }
              }
          }
      }
      
      
      pipeline {
          agent { node { label 'master'} }
          
          triggers { cron('H * * * *')} 
          
          stages{
              stage ('Do the cleanup') {
                  steps {
                      script {
                          if (builders == [:]) {
                              println "No nodes found"
                              currentBuild.result = 'SUCCESS'
                              return
                          }
                          parallel builders
                      }
                  }
              }
          }
      }
      
      
      

        Attachments

          Activity

          eplodn1 efo plo created issue -

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            eplodn1 efo plo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: