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

Catch error block sets upstream job to aborted when downstream is aborted

XMLWordPrintable

      Hi,

      I will attach files with example pipeline for the problems I describe below and screenshots.

      We want to setup a job that triggers three downstream jobs with enabled fail fast for only two of them and not the third (if one of the first two fails, others are aborted, but if the third fails we let the other two finish ) - attachment parallel-build-job-pipeline.txt. The way we start doing this if by using catchError block around the third job. This seems to work as expected, but there is a problem when the third job gets aborted by one of the other two failing, then the status of the upstream becomes aborted and not failed.  We tested with catchInterruptions = false, but the problem persists. Strangely, when testing with a simpler setup where the build job directive is replaced by simple sleep, then the catchInterruptions works as expected - attachment parallel-sleep-pipeline.txt.

      We tried using a try-catch block as a workaround, but as far as I can see there is no way currently to set the status of the stage, so we could see it in Blue Ocean. Try-catch just swallows the errors and sets the status to SUCCESS always.

      It would seem a strange if this is the desired behavior and there is no way to achieve this. Please comment here and advise on a way to implement this.

       

      Best Regards,

      Mihail

       

        1. parallel-build-job-pipeline.txt
          0.8 kB
          Mihail Milkov
        2. parallel-sleep-pipeline.txt
          0.8 kB
          Mihail Milkov
        3. Pipeline-Blue-Ocean-UI.JPG
          52 kB
          Mihail Milkov

            Unassigned Unassigned
            mihailmilkov Mihail Milkov
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: