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

multiple parallel parameterized builds seem to happen at once

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

      Currently Hudson does not allow multiple builds in parallel for the same
      project. However when a project is parameterized, this IS possible.

      This is very dangerous, since it's perfectly possible that two builds will be
      started on the same workspace. Imagine your workspace being updated by one build
      while the other one is still doing the build. You might not even notice
      something wrong has happened but your build results would be completely bogus.

      The current workaround is to make sure you do only one parallel build per node.

      The immediate solution is to disable parallel builds in the core, but this
      requires implementing equals() and hashcode() differently on ALL Queue.Task
      implementers.

      The final solution is to implement decent locking, and fix all other places in
      Hudson that depend on only having one build running.

          [JENKINS-2997] multiple parallel parameterized builds seem to happen at once

          huybrechts created issue -

          huybrechts added a comment -

          working on it

          huybrechts added a comment - working on it
          huybrechts made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          huybrechts made changes -
          Link New: This issue is blocking JENKINS-3004 [ JENKINS-3004 ]

          huybrechts added a comment -

          Created an attachment (id=552)
          proposed patch

          huybrechts added a comment - Created an attachment (id=552) proposed patch

          huybrechts added a comment -

          proposed patch passes Actions when queuing a build

          TODO:

          • verify queue.xml serialization (backward compatible ?)

          TODO (optional):

          • implement an optional interface BuildWrappingAction that can influence the build
          • implement parameters on top of this
          • implement UI when scheduling a build
          • implement parameter asking on top of this

          huybrechts added a comment - proposed patch passes Actions when queuing a build TODO: verify queue.xml serialization (backward compatible ?) TODO (optional): implement an optional interface BuildWrappingAction that can influence the build implement parameters on top of this implement UI when scheduling a build implement parameter asking on top of this

          Alan Harder added a comment -

          one comment on the patch: I see one spot in AbstractProject diffs where
          quietPeriod was replaced with zero.

          one question: before this change you could go schedule several builds with
          different parameters.. the dangerous part was these builds running in parallel,
          but I guess it was good they could all be in the queue. with this patch what
          happens if you submit a parameterized build when one for the same project is
          already in the queue (even with different parameters)?

          Alan Harder added a comment - one comment on the patch: I see one spot in AbstractProject diffs where quietPeriod was replaced with zero. one question: before this change you could go schedule several builds with different parameters.. the dangerous part was these builds running in parallel, but I guess it was good they could all be in the queue. with this patch what happens if you submit a parameterized build when one for the same project is already in the queue (even with different parameters)?

          huybrechts added a comment -

          Created an attachment (id=554)
          This version allows multiple scheduled builds for parameterized projects, but no parallel building. Still WIP.

          huybrechts added a comment - Created an attachment (id=554) This version allows multiple scheduled builds for parameterized projects, but no parallel building. Still WIP.

          Alan Harder added a comment -

          patch is getting long.. I didn't make it thru all the Queue.java stuff yet, but
          did notice: diff in MatrixConfiguration doesn't use the Cause parameter anymore

          Alan Harder added a comment - patch is getting long.. I didn't make it thru all the Queue.java stuff yet, but did notice: diff in MatrixConfiguration doesn't use the Cause parameter anymore

          Alan Harder added a comment -

          Looks like ParametersAction always allows the same job to be added in the queue.
          In previous(current) code it was using equality of the Task objects to avoid
          duplicates, so a job submitted with the same set of parameters would not get
          scheduled again.
          Seems like this aspect is somewhat important, as jobs with parameters may still
          be invoked via SCM or Timer with the default parameters.. if a build is blocked
          (waiting on executor, etc) and it keeps polling and triggering, we could end up
          with tons of scheduled jobs with the same default parameters. What do you think?

          Alan Harder added a comment - Looks like ParametersAction always allows the same job to be added in the queue. In previous(current) code it was using equality of the Task objects to avoid duplicates, so a job submitted with the same set of parameters would not get scheduled again. Seems like this aspect is somewhat important, as jobs with parameters may still be invoked via SCM or Timer with the default parameters.. if a build is blocked (waiting on executor, etc) and it keeps polling and triggering, we could end up with tons of scheduled jobs with the same default parameters. What do you think?

            Unassigned Unassigned
            huybrechts huybrechts
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: