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

Jenkins concurrent builds not working when triggered simultaneously

    Details

    • Similar Issues:

      Description

      Hi Team,

      Facing problem while trying to trigger concurrent executions of a job via Jenkins API.

      Have configured a job to run builds concurrently.

      It works fine when the jobs are triggered after a few minutes. Execute first job run, let it get started and then start the second job run. Both the first and second jobs run concurrently now and we get separate build ids for each job run.

      However, when we try to execute job concurrently at the same time it just triggers one execution of the job and returns its build id.

      Have tested it with both the python-jenkins wrapper and Jenkins python REST API. Please find both the scripts attached.

      Suspect the queue does not take more then one instance of the job at a given time. Can only see one instance of my job on the queue when we trigger simultaneous invocation.

      Tried to change the build parameters as well but still face the same problem.

      Can someone please help.

      Regards,

      Narendra Patel

        Attachments

        1. config.xml
          2 kB
        2. jenkins_rest_api.py
          1 kB
        3. python-jenkins.py
          1 kB

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment - - edited

          Please check parameters you pass to the job. If the parameters are same, Jenkins Queue merges pending tasks

          Show
          oleg_nenashev Oleg Nenashev added a comment - - edited Please check parameters you pass to the job. If the parameters are same, Jenkins Queue merges pending tasks
          Hide
          narendrapatel Narendra Patel added a comment -

          Hi Oleg,

          Have tried it with different parameters as well. Same issue.

          By parameters i mean the values to the parameters, the count/name of parameters is the same.

          You can also have a look at the attached scripts that we are using.
          python-jenkins would require pip install of python-jenkins.
          jenkins_rest_api.py should only require Python 2.7

          Regards,

          Narendra Patel

          Show
          narendrapatel Narendra Patel added a comment - Hi Oleg, Have tried it with different parameters as well. Same issue. By parameters i mean the values to the parameters, the count/name of parameters is the same. You can also have a look at the attached scripts that we are using. python-jenkins would require pip install of python-jenkins. jenkins_rest_api.py should only require Python 2.7 Regards, Narendra Patel
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          If the parameters are same, it works as expected. Please provide the job's config.xml just in case there is something inside.

          Show
          oleg_nenashev Oleg Nenashev added a comment - If the parameters are same, it works as expected. Please provide the job's config.xml just in case there is something inside.
          Hide
          narendrapatel Narendra Patel added a comment -

          Hi Oleg,

          Please find the config.xml attached to the case.

          Thank you for helping us out here!!

          Regards,

          Narendra Patel

          Show
          narendrapatel Narendra Patel added a comment - Hi Oleg, Please find the config.xml attached to the case. Thank you for helping us out here!! Regards, Narendra Patel
          Hide
          narendrapatel Narendra Patel added a comment -

          Hi Oleg,

          Did you got a chance to have a look at the configuration file.

          Show
          narendrapatel Narendra Patel added a comment - Hi Oleg, Did you got a chance to have a look at the configuration file.
          Hide
          narendrapatel Narendra Patel added a comment -

          Hi Oleg,

          Have implemented a workaround for time being.

          Before building a job my code polls the jenkins queue and checks if a previous build/instance of the current job is already in queue. If yes, then it waits for a pre-configured amount of time and periodically polls, in this time interval, the queue again to check if the job is sent of execution and is no more in the queue. If yes, then it initiates my new build else it timeouts and raises my custom exception.

          Regards,

          Narendra Patel

          Show
          narendrapatel Narendra Patel added a comment - Hi Oleg, Have implemented a workaround for time being. Before building a job my code polls the jenkins queue and checks if a previous build/instance of the current job is already in queue. If yes, then it waits for a pre-configured amount of time and periodically polls, in this time interval, the queue again to check if the job is sent of execution and is no more in the queue. If yes, then it initiates my new build else it timeouts and raises my custom exception. Regards, Narendra Patel
          Hide
          pezinek Petr ZahradnĂ­k added a comment -

          Same problem here, however it seems to help if the build job is submitted with quietPeriod: 0

          Show
          pezinek Petr ZahradnĂ­k added a comment - Same problem here, however it seems to help if the build job is submitted with quietPeriod: 0

            People

            • Assignee:
              Unassigned
              Reporter:
              narendrapatel Narendra Patel
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: