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

Problems when running the batch task in parallel with the main job

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I am using the Batch Task plugin to perform releases for my Hudson jobs. But every once in a while, Hudson would start the real job in parallel with the release task, and almost always, this leads to failed builds with very odd behaviors.

      I am using a high frequency for checking CVS changes, about once every 15 minutes (I should change this, but that is a different problem), and when the release task checks in the updated POM into CVS, then this shows up as a code change, and Hudson would start the main job, even though the batch task is not done yet.

      To prevent this issue, I have to disable the main job when I start a batch task to prevent the race condition, and once the release is complete, I enable the job again. The problem is that I often forget this.

      It would be real nice if Hudson or the Batch task can use a form of a lock for the workspace to ensure that only one job/batch can execute at a given time.

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          hm, there is a lock on the workspace and I've definitely tested that a task won't start when a build is running.. haven't tried the reverse though, and that's the case you mention. I'll give it a try.

          Show
          mindless Alan Harder added a comment - hm, there is a lock on the workspace and I've definitely tested that a task won't start when a build is running.. haven't tried the reverse though, and that's the case you mention. I'll give it a try.
          Hide
          mindless Alan Harder added a comment -

          confirmed.. task won't stop a new build. Nor will one task block another task on the same project from running.

          Show
          mindless Alan Harder added a comment - confirmed.. task won't stop a new build. Nor will one task block another task on the same project from running.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchRun.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=25867
          Log:
          [FIXED JENKINS-5285] acquire lock on the workspace while task runs, to prevent
          the owner project or other tasks from using the same ws during the task run.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchRun.java http://fisheye4.cenqua.com/changelog/hudson/?cs=25867 Log: [FIXED JENKINS-5285] acquire lock on the workspace while task runs, to prevent the owner project or other tasks from using the same ws during the task run.
          Hide
          mindless Alan Harder added a comment -

          I fixed this, although it uses the same mechanism as SCM polling.. which means it doesn't show as blocked in the build queue, but rather the build is kicked off but then it waits for the workspace lock to be freed up.. sry, best I can do right now.

          Show
          mindless Alan Harder added a comment - I fixed this, although it uses the same mechanism as SCM polling.. which means it doesn't show as blocked in the build queue, but rather the build is kicked off but then it waits for the workspace lock to be freed up.. sry, best I can do right now.
          Hide
          chrisgwarp Chris Graham added a comment -

          I am now suffering from the same issue. Is there any chance that we can roll out a release that includes this fix?

          -Chris

          Show
          chrisgwarp Chris Graham added a comment - I am now suffering from the same issue. Is there any chance that we can roll out a release that includes this fix? -Chris
          Hide
          mindless Alan Harder added a comment -

          Sorry for the delay.. I fixed one more issue and just rolled out the release; should be available in a few hours.

          Show
          mindless Alan Harder added a comment - Sorry for the delay.. I fixed one more issue and just rolled out the release; should be available in a few hours.
          Hide
          chrisgwarp Chris Graham added a comment -

          Thanks!

          Greatly appreciated.

          -Chris

          Show
          chrisgwarp Chris Graham added a comment - Thanks! Greatly appreciated. -Chris

            People

            • Assignee:
              mindless Alan Harder
              Reporter:
              fshehadeh fshehadeh
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: