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

2 Jobs w/same repo. Job triggers twice when first triggered job is Git SCM is still downloading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • CentOS 5, JDK 1.7

      Problem:
      A job keeps triggering when it should not.

      Background:
      2 separate jobs are configured to be triggered on the same Github repository depending on branch that pushed to.

      When pushing to the 1st branch, "origin/test/branch1", the 1st job is triggered. Good.
      When pushing to the 2nd branch, "origin/test/branch2", the 2nd job triggers. Good.
      But the 1st job is triggered again. Bad. There's only been 2 pushes.

      The repository is very large, so the git clone takes a few minutes for both jobs.

      The problem consistently occurs when pushing to the 1st branch, THEN immediately pushing to the 2nd branch. The 1st job is triggered and git cloning. And the 2nd job is triggered and queued. BUT another 1st job is triggered and queued.

      Seems to happen when it's still downloading during the clone.

      That extra triggered job is causing us grief, because it's used for deployments.

      This is reproducible consistently with this script:

      ----------------------------
      #!/bin/bash
      pushd mydirectory
      git checkout develop
      echo ${1}d >> d.txt
      git add .
      git commit -m "${1}d"
      git push

      git checkout test/branch1
      git pull --no-edit upstream develop
      git push

      git checkout test/branch2
      git pull --no-edit upstream test/branch1
      git push
      popd
      ----------------------------

      And run it as:

      1. ./script 1
      2. ./script 2
        etc...

      Jenkins v1.558
      Git Client v1.9.1
      Git plugin v2.2.1
      GitHub API v1.54
      Github OAuth v0.14
      GitHub Pull Request Builder 1.12
      GitHub plugin v1.8

            Unassigned Unassigned
            tokyowizard Frank Lee
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: