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

the downstream build result was not updated correctly when it is triggered by multiple builds

      reproduce steps:
      0. config jobA and jobB, jobB is downstream of jobA; and jobA were configured with promotion condition "When the following downstream projects build successfully".
      1. trigger two builds(build 1 and 2) of "jobA" in short time;
      2. the downstream job "jobB" scheduled one build for the two upstream builds(jobA build 1 and 2), and the build finished sucessfully

      Unexpected result:

      Trying to promote the build 2 of jobA, the condition of the downstream projects build successfully was not satisfied.

          [JENKINS-16213] the downstream build result was not updated correctly when it is triggered by multiple builds

          li wei added a comment -

          to fix this bug:

          remove "break" in 241 line of hudson.plugins.release_builds.conditions.DownstreamPassCondition

          li wei added a comment - to fix this bug: remove "break" in 241 line of hudson.plugins.release_builds.conditions.DownstreamPassCondition

          Kari Sivonen added a comment -

          To do this more cleaver, I take example from copy artifact plugin where is introduced global and job's parameter upstreamFilterStrategy. In Global parameter there is options UseOldest and UseNewest. In job configuration there is als option UseGlobalSetting. Depending selection latest or oldest job is promoted.

          Kari Sivonen added a comment - To do this more cleaver, I take example from copy artifact plugin where is introduced global and job's parameter upstreamFilterStrategy. In Global parameter there is options UseOldest and UseNewest. In job configuration there is als option UseGlobalSetting. Depending selection latest or oldest job is promoted.

          Jesse Glick added a comment -

          I am doubtful that introducing a new option is necessary here. Probably a user error (failure to properly associate upstream and downstream builds via fingerprints); if fingerprints are in use and it is still promoting the wrong build, that is simply a bug that should not require the user to configure anything differently.

          Jesse Glick added a comment - I am doubtful that introducing a new option is necessary here. Probably a user error (failure to properly associate upstream and downstream builds via fingerprints); if fingerprints are in use and it is still promoting the wrong build, that is simply a bug that should not require the user to configure anything differently.

          Kari Sivonen added a comment - - edited

          I tried to start using latest version of this plug in and I configured fingerprints, but it still not works. I tried configurations in our test environment and it works there, but our production environment it not works.

          How I can get more debug data where this goes wrong?

          If I looks fingerprints everything should be right, but still wrong job is promoted!

          File fingerprint:
          *ECL_revision_info.txt
          MD5: 9704d173266ee53265bc89d6d8c87a05
          Introduced 20 hr ago SuccessECL_HWAPI_MAINBRANCH #10705
          Usage

          This file has been used in the following places:
          ECL_HWAPI_MAINBRANCH Success#10705
          ...*
          There is a lot of jobs used this, but here is most important
          *...
          PS_Release_Promo_MAINBRANCH Success#7214
          PS_Release_Promo_QUEUE_MAINBRANCH Unstable#2449
          ...*

          This Promo_Queue job is started by many PS_Promo_Release builds, but ECL_version_info.txt is copied from build 7214, which then should also be promoted. BUT the promoted build was 7211, which was first job triggered this queue job.

          Very hard to get it pointed here out, but the case was that from build is promoted. How I can get more info what happens? This happens only in our production CI so we cannot do much which stops Jenkins to run.

          Kari Sivonen added a comment - - edited I tried to start using latest version of this plug in and I configured fingerprints, but it still not works. I tried configurations in our test environment and it works there, but our production environment it not works. How I can get more debug data where this goes wrong? If I looks fingerprints everything should be right, but still wrong job is promoted! File fingerprint: *ECL_revision_info.txt MD5: 9704d173266ee53265bc89d6d8c87a05 Introduced 20 hr ago SuccessECL_HWAPI_MAINBRANCH #10705 Usage This file has been used in the following places: ECL_HWAPI_MAINBRANCH Success#10705 ...* There is a lot of jobs used this, but here is most important *... PS_Release_Promo_MAINBRANCH Success#7214 PS_Release_Promo_QUEUE_MAINBRANCH Unstable#2449 ...* This Promo_Queue job is started by many PS_Promo_Release builds, but ECL_version_info.txt is copied from build 7214, which then should also be promoted. BUT the promoted build was 7211, which was first job triggered this queue job. Very hard to get it pointed here out, but the case was that from build is promoted. How I can get more info what happens? This happens only in our production CI so we cannot do much which stops Jenkins to run.

          Kari Sivonen added a comment -

          I find a issue (bug?) from Jenkins fingerprint handling and upstream relationships.

          Example1 Working case:

          Job1#1 artifact/fingerprint file1 and trigger job2#1, which getArtifactsFrom upstream job and fingerprint it..

          In script console:
          import jenkins.model.*
          def job2 = Jenkins.instance.getJob("job2")
          def build2=job.getBuildByNumber(1)
          def job1 = Jenkins.instance.getJob("job1")

          build2.getUpstreamRelationshipBuild(job1); // this return job1#1 GREAT!

          Example2 NOT Working case:

          JobA artifact/fingerprint file1 and trigger job1, which getArtifactsFrom upstream job and fingerprint it. Then this continues like working example 1.
          Job1#1 artifact/fingerprint file1 and trigger job2#1, which getArtifactsFrom upstream job and fingerprint it..

          In script console:
          import jenkins.model.*
          def job2 = Jenkins.instance.getJob("job2")
          def build2=job.getBuildByNumber(1)
          def job1 = Jenkins.instance.getJob("job1")

          build2.getUpstreamRelationshipBuild(job1) // this return null DAMN!
          build2.getUpstreamBuilds() /this returns [:]
          build2.getTransitiveUpstreamBuilds() //this returns jobA object

          But point is that promotion not work as there is upstreamRelationShip broken. Workaround for this is that you made own specific file in job1 and fingerprint that in job1 and job2

          Kari Sivonen added a comment - I find a issue (bug?) from Jenkins fingerprint handling and upstream relationships. Example1 Working case: Job1#1 artifact/fingerprint file1 and trigger job2#1, which getArtifactsFrom upstream job and fingerprint it.. In script console: import jenkins.model.* def job2 = Jenkins.instance.getJob("job2") def build2=job.getBuildByNumber(1) def job1 = Jenkins.instance.getJob("job1") build2.getUpstreamRelationshipBuild(job1); // this return job1#1 GREAT! Example2 NOT Working case: JobA artifact/fingerprint file1 and trigger job1, which getArtifactsFrom upstream job and fingerprint it. Then this continues like working example 1. Job1#1 artifact/fingerprint file1 and trigger job2#1, which getArtifactsFrom upstream job and fingerprint it.. In script console: import jenkins.model.* def job2 = Jenkins.instance.getJob("job2") def build2=job.getBuildByNumber(1) def job1 = Jenkins.instance.getJob("job1") build2.getUpstreamRelationshipBuild(job1) // this return null DAMN! build2.getUpstreamBuilds() /this returns [:] build2.getTransitiveUpstreamBuilds() //this returns jobA object But point is that promotion not work as there is upstreamRelationShip broken. Workaround for this is that you made own specific file in job1 and fingerprint that in job1 and job2

          ay git added a comment -

          I am having this same issue.  Did you ever find a workaround? Even fingerprinting is not working for me. Strangely it works for some job setups but not others. 

          ay git added a comment - I am having this same issue.  Did you ever find a workaround? Even fingerprinting is not working for me. Strangely it works for some job setups but not others. 

            karisivo Kari Sivonen
            liweing li wei
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: