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

Pipeline stages which include a shell script to cat a long log file can lock up the browser

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • blueocean-plugin
    • Client:
      Microsoft Windows 10 Professional
      Microsoft Edge 38.14393.0.0
      Google Chrome 57.0.2987.110 (64-bit)

      Jenkins:
      Core 2.32.3
      BlueOcean 1.0.0-rc1
    • Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2, Blue Ocean 1.1-beta4, Blue Ocean 1.1, Blue Ocean 1.1

      Scope

      • Change button to "Show More"
      • Only show the next 64k log page
        • never inject the whole log
      • Investigate how we can more efficiently render items "cooperatively" (yielding) vs handling/parsing as one big chunk

      Summary
      When building from a Jenkinsfile which includes a stage that runs "cat /var/log/jenkins/jenkins.log," displaying the output of that shell step can cause browser performance to degrade noticably. Sometimes this will result in Chrome prompting the user to kill the tab altogether because it's gone unresponsive.

      Steps to recreate:
      1. Create a Pipeline, using GitHub, which uses a Declarative Pipeline Jenkinsfile.
      2. This Jenkinsfile should include a stage which includes the following:

              stage("I won a hat this weekend") {
                  steps {
                      echo "It was a very expensive hat."
                      sh 'cat /var/log/jenkins/jenkins.log'
                  }
              }
      

      3. Run the build and allow it to complete.
      4. Go to the stage which has the shell step which cats the Jenkins log.
      5. Click on the Step which has the log file in it. In this screenshot, it's the second step, labeled as Shell Script:

      6. Notice that after clicking on it, you'll see a very long log. There are 2258 lines being shown at present. At the top there's a button that says "Show complete log"


      7. Click "Show complete log." In MS Edge, you'll get a thin blue line, and eventually, the tab will show as "Not responding." I was unable to get the screenshot to display the error message, I guess because when it was displaying it, the entire browser kind of went out to lunch. CPU fans spun up A LOT as well.

          [JENKINS-42995] Pipeline stages which include a shell script to cat a long log file can lock up the browser

          Karl Shultz added a comment - - edited

          Chrome behaves somewhat similarly. Clicking "Show complete log" results in a thin blue progress bar, and my laptop's fans spin up higher and higher. Soon after, Chrome asks me if I want to kill the page or wait.

          Karl Shultz added a comment - - edited Chrome behaves somewhat similarly. Clicking "Show complete log" results in a thin blue progress bar, and my laptop's fans spin up higher and higher. Soon after, Chrome asks me if I want to kill the page or wait.

          Michael Neale added a comment -

          tscherler I wonder if this is flooding with events or something else to do with streaming? 

          Michael Neale added a comment - tscherler I wonder if this is flooding with events or something else to do with streaming? 

          hmm, sounds like react not handling that big log very well. We do multiple iterations of render some lines do down render some more AFTER the blue thin line (that is our loading bar BTW  ) But it sounds that we do not even get there. 

           

          One small nit ` sh 'cat /var/log/jenkins/jenkins.log'`would lead on my system to `cat: /var/log/jenkins/jenkins.log: No such file or directory`

          Thorsten Scherler added a comment - hmm, sounds like react not handling that big log very well. We do multiple iterations of render some lines do down render some more AFTER the blue thin line (that is our loading bar BTW  ) But it sounds that we do not even get there.    One small nit ` sh 'cat /var/log/jenkins/jenkins.log'`would lead on my system to `cat: /var/log/jenkins/jenkins.log: No such file or directory`

          Karl Shultz added a comment -

          I eventually figured it was the loading bar. When I first started the draft of this issue, I was testing with Edge. Its behavior was such that there wasn't any animation showing in the bar, so it looked like a rendering glitch at the time.

          Karl Shultz added a comment - I eventually figured it was the loading bar. When I first started the draft of this issue, I was testing with Edge. Its behavior was such that there wasn't any animation showing in the bar, so it looked like a rendering glitch at the time.

          Michael Neale added a comment -

          Added a cat on a log to help Thorsten: 

           

          Michael Neale added a comment - Added a cat on a log to help Thorsten:   

          Thorsten Scherler added a comment - rofl michaelneale

          Michael Neale added a comment -

          Marked this for tech debt sweep as I suspect there are other long standing known things we want to revisit with the log viewer .

          Michael Neale added a comment - Marked this for tech debt sweep as I suspect there are other long standing known things we want to revisit with the log viewer .

            Unassigned Unassigned
            kshultz Karl Shultz
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: