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

dangerous bug with buildWithParameters option.

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • core
    • None
    • Platform: All, OS: All

      I have created a single configuration project with "This build is parameterized"
      option.
      o VARIABLE NAME : FOO
      o goto the shell script and echo $FOO;sleep 120

      Now saved the configuration and started the build using following URL...

      http://localhost:8080/job/buildWithParameters/buildWithParameters?FOO=TEST1

      Now build #1 started.

      While the build #1 is going on, I have started few more builds.
      http://localhost:8080/job/buildWithParameters/buildWithParameters?FOO=TEST2
      http://localhost:8080/job/buildWithParameters/buildWithParameters?FOO=TEST3
      http://localhost:8080/job/buildWithParameters/buildWithParameters?FOO=TEST4
      http://localhost:8080/job/buildWithParameters/buildWithParameters?FOO=TEST5
      http://localhost:8080/job/buildWithParameters/buildWithParameters?FOO=TEST6

      When the build #1 is completed, build #2 & build #3 are started together.

      When the build #2 & #3 completed, build #4 & #5 are getting started together.

          [JENKINS-3154] dangerous bug with buildWithParameters option.

          vijayj added a comment -

          Here is the scenario for multi configuration project:

          o Currently the build is running for multi configuration project build #150
          o I have submitted new build request through buildWithParameters and that
          created build #151 in the Queue
          (buildWithParameters?CHANGEID=95111&token=XXXXXXXXXXXXX).
          o One more requested submitted through buildWithParameters and that created
          build #152 in the Queue (buildWithParameters?CHANGEID=95112&token=XXXXXXXXXXXXX).
          o Now the build #150 completed:

          • build #151 & build #152 are removed from Queue and started the builds for
            #151 & 152 together.

          o #151: Within the few mins: Build #151 only executes master thread and the
          marks the build as aborted but triggered all the slave process and they are
          waiting in the Queue.
          <log>
          Triggering linux
          Triggering windows
          Triggering solaris
          linux appears to be cancelled
          windows appears to be cancelled
          solaris appears to be cancelled
          finished: ABORTED
          </log>

          O#152: Build #152 completes the master thread and starts the slave process.

          • Now all the slave builds runs twice.
          • First runs with CHANGEID=95111
          • Second it runs with CHANGEID=95112
          • Now the #152 has the artifacts for both #151 & 152.

          vijayj added a comment - Here is the scenario for multi configuration project: o Currently the build is running for multi configuration project build #150 o I have submitted new build request through buildWithParameters and that created build #151 in the Queue (buildWithParameters?CHANGEID=95111&token=XXXXXXXXXXXXX). o One more requested submitted through buildWithParameters and that created build #152 in the Queue (buildWithParameters?CHANGEID=95112&token=XXXXXXXXXXXXX). o Now the build #150 completed: build #151 & build #152 are removed from Queue and started the builds for #151 & 152 together. o #151: Within the few mins: Build #151 only executes master thread and the marks the build as aborted but triggered all the slave process and they are waiting in the Queue. <log> Triggering linux Triggering windows Triggering solaris linux appears to be cancelled windows appears to be cancelled solaris appears to be cancelled finished: ABORTED </log> O#152: Build #152 completes the master thread and starts the slave process. Now all the slave builds runs twice. First runs with CHANGEID=95111 Second it runs with CHANGEID=95112 Now the #152 has the artifacts for both #151 & 152.

          Alan Harder added a comment -

          watch the console output for 2 instances that have both been assigned an
          executor.. do both actually echo $FOO before either one ends, or does one block
          the other until in completes and then the next one echoes $FOO?

          Alan Harder added a comment - watch the console output for 2 instances that have both been assigned an executor.. do both actually echo $FOO before either one ends, or does one block the other until in completes and then the next one echoes $FOO?

          vijayj added a comment -

          For single configuration:
          =========================

          > does one block the other until in completes and then the next one echoes $FOO?

          2nd one gets blocked until the first one echoes $FOO & completes.

          For Multi configuration:
          ========================

          The problem is very major with multi configuration, because both the builds
          completes the master thread (not sure about order of the console out for master
          thread) then triggers the slave process almost at the same time but some how the
          first build is getting marked as aborted. Second build go onto execute slave
          threads twice for the same build (2nd)...

          vijayj added a comment - For single configuration: ========================= > does one block the other until in completes and then the next one echoes $FOO? 2nd one gets blocked until the first one echoes $FOO & completes. For Multi configuration: ======================== The problem is very major with multi configuration, because both the builds completes the master thread (not sure about order of the console out for master thread) then triggers the slave process almost at the same time but some how the first build is getting marked as aborted. Second build go onto execute slave threads twice for the same build (2nd)...

          I thought Tom fixed this in a very recent version of Hudson.
          Which version are you using?

          Kohsuke Kawaguchi added a comment - I thought Tom fixed this in a very recent version of Hudson. Which version are you using?

          huybrechts added a comment -

          When two builds of the same project are in the queue, then they will be
          scheduled at the same time. This occupies a node unnecessarily, but otherwise
          locking on the workspace is still working fine, so they don't actually run in
          parallel.

          Maybe there is some strange interaction with matrix builds, but I still don't
          think that two builds can actually run in parallel. I'd have to try it out, or
          better yet, write some test cases.

          huybrechts added a comment - When two builds of the same project are in the queue, then they will be scheduled at the same time. This occupies a node unnecessarily, but otherwise locking on the workspace is still working fine, so they don't actually run in parallel. Maybe there is some strange interaction with matrix builds, but I still don't think that two builds can actually run in parallel. I'd have to try it out, or better yet, write some test cases.

          vijayj added a comment -

          > Which version are you using?

          I was using 1.285.

          vijayj added a comment - > Which version are you using? I was using 1.285.

          vijayj added a comment -

          > Maybe there is some strange interaction with matrix builds,

          We definitely have big issue with matrix project. If you could check this
          scenario then it would be really great.

          vijayj added a comment - > Maybe there is some strange interaction with matrix builds, We definitely have big issue with matrix project. If you could check this scenario then it would be really great.

          I believe it's the same issue.

              • This issue has been marked as a duplicate of 2997 ***

          Kohsuke Kawaguchi added a comment - I believe it's the same issue. This issue has been marked as a duplicate of 2997 ***

            huybrechts huybrechts
            vijayj vijayj
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: