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

Disappearing parallels in karoke

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      Pipeline Model Definition 0.8.2
    • Sprint:
      tethys, pannonian
    • Similar Issues:

      Description

      Steps to reproduce

      1. Build the Pipeline from the source code at https://github.com/i386/app-store-demo (Declarative Jenkinsfile) - or see below to copy and paste
      2. Watch as the parallels completely disappear and then reappear
      3. The "Build" stage also flashes to be "Declarative: Checkout"

      This works fine if it is NOT declarative (so may be worth looking at the data), but I know there was a desire to revisit some of the problem areas in karaoke so I think this is a good chance.

      Ideally we could have this test in the ATH and check for the appearance of nodes correctly.

      Simlified pipeline to use as non multibranch for testing and ATH:

      
      pipeline {
          agent any
          stages {
              stage ('Build') {
                  steps {
                    sh 'echo this stage yo'
                  }
              }
              stage ('Browser Tests') {
                  steps {
                    parallel (
                        'Firefox': {
                            sh "echo 'setting up selenium environment'"
                            sh 'ping -c 5 localhost'
                        },
                        'Safari': {
                            sh "echo 'setting up selenium environment'"
                            sh 'ping -c 8 localhost'
                        },
                        'Chrome': {
                            sh "echo 'setting up selenium environment'"
                            sh 'ping -c 3 localhost'
                        },
                        'Internet Explorer': {
                            sh "echo 'setting up selenium environment'"
                            sh 'ping -c 4 localhost'
                        }
                      )
                  }
              }
              stage ('Static Analysis') {
                  steps {
                    sh 'echo findbugs'
                  }
              }
              stage ('Package') {
                  steps {
                    sh 'echo package > foo.txt'
                  }
              }
          }
      
          post {
              always {
                  
                  archive '**/*.txt'
              }
          }
      }
      

        Attachments

          Activity

          Hide
          tscherler Thorsten Scherler added a comment - - edited
          raoke] with key: /jenkins/blue/rest/organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/
           Object {_links: Object, key: 1, id: "11", edges: Array[4], displayName: "Browser Tests"…}
          [DEBUG - io.jenkins.blueocean.karaoke] with key: /jenkins/blue/rest/organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/
           Object {_links: Object, key: 1, id: "11", edges: Array[4], displayName: "Browser Tests"…}
          [DEBUG - io.jenkins.blueocean.karaoke] with key: /jenkins/blue/rest/organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/
           Object {_links: Object, key: 1, id: "11", edges: Array[4], displayName: "Browser Tests"…}
          [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: "42ca805e-f73b-436a-8e82-73361891017d", sse_subs_dispatcher_inst: "668735240", jenkins_org: "jenkins", pipeline_stage_is_parallel: "true", pipeline_job_name: "prettyParallel"…}
          [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server
          [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: "3d5eac77-9926-4fa2-bd5c-a8bf16882917", sse_subs_dispatcher_inst: "668735240", jenkins_org: "jenkins", pipeline_stage_is_parallel: "true", pipeline_job_name: "prettyParallel"…}
          [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server
          [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: "ea7920e5-35cc-4d8c-abf3-6400fabccd2c", sse_subs_dispatcher_inst: "668735240", jenkins_org: "jenkins", pipeline_stage_is_parallel: "true", pipeline_job_name: "prettyParallel"…}
          [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server
          [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: "6b5eca63-b9e5-4b59-97c5-1464331acffa", sse_subs_dispatcher_inst: "668735240", jenkins_org: "jenkins", pipeline_stage_is_parallel: "true", pipeline_job_name: "prettyParallel"…}
          [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server
          [DEBUG - io.jenkins.blueocean.karaoke] with key: /jenkins/blue/rest/organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/
           Object {_links: Object, key: 1, id: "11", edges: Array[1], displayName: "Browser Tests"…}
          

          see how Array[4] switches to Array[1] After the events with pipeline_stage_is_parallel: "true" are coming in. That is just after the refetching, so Vivek Pandey the REST is returning "old" data.

          That is what Karaoke displays. ...now to see how we can workaround that

          Show
          tscherler Thorsten Scherler added a comment - - edited raoke] with key: /jenkins/blue/ rest /organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/ Object {_links: Object , key: 1, id: "11" , edges: Array[4], displayName: "Browser Tests" …} [DEBUG - io.jenkins.blueocean.karaoke] with key: /jenkins/blue/ rest /organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/ Object {_links: Object , key: 1, id: "11" , edges: Array[4], displayName: "Browser Tests" …} [DEBUG - io.jenkins.blueocean.karaoke] with key: /jenkins/blue/ rest /organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/ Object {_links: Object , key: 1, id: "11" , edges: Array[4], displayName: "Browser Tests" …} [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: " 42ca805e-f73b-436a-8e82-73361891017d ", sse_subs_dispatcher_inst: " 668735240 ", jenkins_org: " jenkins ", pipeline_stage_is_parallel: " true ", pipeline_job_name: " prettyParallel"…} [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: " 3d5eac77-9926-4fa2-bd5c-a8bf16882917 ", sse_subs_dispatcher_inst: " 668735240 ", jenkins_org: " jenkins ", pipeline_stage_is_parallel: " true ", pipeline_job_name: " prettyParallel"…} [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: " ea7920e5-35cc-4d8c-abf3-6400fabccd2c ", sse_subs_dispatcher_inst: " 668735240 ", jenkins_org: " jenkins ", pipeline_stage_is_parallel: " true ", pipeline_job_name: " prettyParallel"…} [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server [LOG - org.jenkinsci.sse] Received event "pipeline/pipeline_block_start: Object {jenkins_event_uuid: " 6b5eca63-b9e5-4b59-97c5-1464331acffa ", sse_subs_dispatcher_inst: " 668735240 ", jenkins_org: " jenkins ", pipeline_stage_is_parallel: " true ", pipeline_job_name: " prettyParallel"…} [DEBUG - io.jenkins.blueocean.karaoke] re-fetching from server [DEBUG - io.jenkins.blueocean.karaoke] with key: /jenkins/blue/ rest /organizations/jenkins/pipelines/prettyParallel/runs/21/nodes/ Object {_links: Object , key: 1, id: "11" , edges: Array[1], displayName: "Browser Tests" …} see how Array [4] switches to Array [1] After the events with pipeline_stage_is_parallel: "true" are coming in. That is just after the refetching, so Vivek Pandey the REST is returning "old" data. That is what Karaoke displays. ...now to see how we can workaround that
          Hide
          vivek Vivek Pandey added a comment -

          Thorsten Scherler This is really strange. API returns execution state (its serialized on file system) so for it to change, that is parallel nodes size change is something I can't see that happening. Maybe there is something or there is some bug somewhere in underlying workflow api that gives different parallel branches on multiple requests. I am going to test it thoroughly and get back.

          Or maybe could it be that there is some async behavior or the logs are interleaved, is it possible to print logs with timestamp?

          Show
          vivek Vivek Pandey added a comment - Thorsten Scherler This is really strange. API returns execution state (its serialized on file system) so for it to change, that is parallel nodes size change is something I can't see that happening. Maybe there is something or there is some bug somewhere in underlying workflow api that gives different parallel branches on multiple requests. I am going to test it thoroughly and get back. Or maybe could it be that there is some async behavior or the logs are interleaved, is it possible to print logs with timestamp?
          Hide
          vivek Vivek Pandey added a comment -

          Thorsten Scherler Looks like a bug in how union/merge of current and last successful pipeline parallels are merged. I am going to work on a fix.

          Show
          vivek Vivek Pandey added a comment - Thorsten Scherler Looks like a bug in how union/merge of current and last successful pipeline parallels are merged. I am going to work on a fix.
          Hide
          jamesdumay James Dumay added a comment -

          Good job on tracking these down Thorsten Scherler and Vivek Pandey!

          Show
          jamesdumay James Dumay added a comment - Good job on tracking these down Thorsten Scherler and Vivek Pandey !
          Hide
          vivek Vivek Pandey added a comment -

          Thorsten Scherler Sorry to have wasted your time investigating it, should have looked closely at union functionality of partial execution of pipeline with projected ones. PTAL PR https://github.com/jenkinsci/blueocean-plugin/pull/737.

          Show
          vivek Vivek Pandey added a comment - Thorsten Scherler Sorry to have wasted your time investigating it, should have looked closely at union functionality of partial execution of pipeline with projected ones. PTAL PR https://github.com/jenkinsci/blueocean-plugin/pull/737 .

            People

            • Assignee:
              vivek Vivek Pandey
              Reporter:
              jamesdumay James Dumay
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: