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

Parallel build steps show as successfully completed when still in proc

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      My build uses dynamic EC2 instances. I have two parallel steps that run. Both provision a new node. One step usually starts a few minutes before the other. When the second step starts, the visualization of the job shows the first step as completed successfully even though it is still in progress.

        Attachments

          Activity

          Hide
          amuniz Antonio Muñiz added a comment -

          Using stage inside parallel is discouraged (almost forbidden). Just avoid it.

          Show
          amuniz Antonio Muñiz added a comment - Using stage inside parallel is discouraged (almost forbidden). Just avoid it.
          Hide
          mscharp Michael Scharp added a comment -

          Antonio, can you please expand on your reasoning for this and a work around for the need to visually see "stages" that are run in parallel?

          There are a ton of valid usecases for needing this functionality. Without going into any specific use case, if a parallel step is wrapped up into a single stage, then when one of those parallel items fails, the only way to know what actually failed is by digging into the console/logs. Being able to use the visualization as a dashboard, and accurately see what is going on is HUGE. Right now I use stages insides of parallel steps so that I can see exactly what my pipeline is doing and where it fails. As mentioned by the reporter, the current visualization doesn't display that information as well as it could/should.

          If you don't want to enhance it because of technical concerns of having stages within parallel steps,

          1. Is there documentation letting pipeline users not to put stages inside of parallel steps?
          2. Could the visualization be enhanced to show parallel steps as "stages" in the view?
          Show
          mscharp Michael Scharp added a comment - Antonio, can you please expand on your reasoning for this and a work around for the need to visually see "stages" that are run in parallel? There are a ton of valid usecases for needing this functionality. Without going into any specific use case, if a parallel step is wrapped up into a single stage, then when one of those parallel items fails, the only way to know what actually failed is by digging into the console/logs. Being able to use the visualization as a dashboard, and accurately see what is going on is HUGE. Right now I use stages insides of parallel steps so that I can see exactly what my pipeline is doing and where it fails. As mentioned by the reporter, the current visualization doesn't display that information as well as it could/should. If you don't want to enhance it because of technical concerns of having stages within parallel steps, Is there documentation letting pipeline users not to put stages inside of parallel steps? Could the visualization be enhanced to show parallel steps as "stages" in the view?
          Hide
          amuniz Antonio Muñiz added a comment -

          can you please expand on your reasoning for this

          The stage step (and the visualization provided by pipeline-stage-view) was never designed to be anything other than serial, and there is nothing planned to make it non-serial.

          There are a ton of valid usecases for needing this functionality.

          Probably. But IMO this should be achieved in some other way, not by using stage. In the future we will have label (JENKINS-26107), milestone (JENKINS-27039) and lock (JENKINS-30269), then we will probably be in a position to think about a solution for this use-cases.

          the current visualization doesn't display that information as well as it could/should

          Yes, perhaps it should, but could not - currently.

          Is there documentation letting pipeline users not to put stages inside of parallel steps?

          No AFAICT.

          Could the visualization be enhanced to show parallel steps as "stages" in the view?

          No without deep changes and it would be an ugly workaround, better to go the right way.

          Show
          amuniz Antonio Muñiz added a comment - can you please expand on your reasoning for this The stage step (and the visualization provided by pipeline-stage-view ) was never designed to be anything other than serial, and there is nothing planned to make it non-serial. There are a ton of valid usecases for needing this functionality. Probably. But IMO this should be achieved in some other way, not by using stage. In the future we will have label ( JENKINS-26107 ), milestone ( JENKINS-27039 ) and lock ( JENKINS-30269 ), then we will probably be in a position to think about a solution for this use-cases. the current visualization doesn't display that information as well as it could/should Yes, perhaps it should , but could not - currently. Is there documentation letting pipeline users not to put stages inside of parallel steps? No AFAICT. Could the visualization be enhanced to show parallel steps as "stages" in the view? No without deep changes and it would be an ugly workaround, better to go the right way.
          Hide
          svanoort Sam Van Oort added a comment -

          > Is there documentation letting pipeline users not to put stages inside of parallel steps?

          No, and this is considered to be an incorrect usage if it is done; stages are only valid as top-level contructs in the pipeline, which is why the notion of labelled blocks as a separate construct has come to be.

          Show
          svanoort Sam Van Oort added a comment - > Is there documentation letting pipeline users not to put stages inside of parallel steps? No, and this is considered to be an incorrect usage if it is done; stages are only valid as top-level contructs in the pipeline, which is why the notion of labelled blocks as a separate construct has come to be.
          Hide
          mscharp Michael Scharp added a comment -

          Thank you both for the explanations. Totally agree doing things the right way is better than throwing a bandaid on it. Glad to see there are plans in the works that position the plugin to be enhanced to show parallel building.

          Regarding the documentation, maybe the TUTORIAL.md could be updated to say stages are top level constructs and should not be used within a parallel step and 1 or 2 reasons why? Without knowing that, I've put them into parallel steps. To my knowledge, I haven't had issues with it (other than visualization), but if that is incorrect usage and could produce some sort of aberrant behavior I'd definitely like to fix it.

          Show
          mscharp Michael Scharp added a comment - Thank you both for the explanations. Totally agree doing things the right way is better than throwing a bandaid on it. Glad to see there are plans in the works that position the plugin to be enhanced to show parallel building. Regarding the documentation, maybe the TUTORIAL.md could be updated to say stages are top level constructs and should not be used within a parallel step and 1 or 2 reasons why? Without knowing that, I've put them into parallel steps. To my knowledge, I haven't had issues with it (other than visualization), but if that is incorrect usage and could produce some sort of aberrant behavior I'd definitely like to fix it.
          Hide
          mscharp Michael Scharp added a comment -

          but if that is incorrect usage and could produce some sort of aberrant behavior I'd definitely like to fix it

          And by that, I mean remove stages from parallel steps within my pipeline.

          Show
          mscharp Michael Scharp added a comment - but if that is incorrect usage and could produce some sort of aberrant behavior I'd definitely like to fix it And by that, I mean remove stages from parallel steps within my pipeline.

            People

            • Assignee:
              amuniz Antonio Muñiz
              Reporter:
              johndament John Ament
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: