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

GitHub Push always builds if workspace is on offline slave node

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • github-plugin
    • None

      If you have a slave node that goes offline when idle that holds the workspace of a build, any GitHub push automatically triggers a build with the message:

      Started on May 24, 2013 8:15:43 PM
      Workspace is offline.
      Scheduling a new build to get a workspace. (nonexisting_workspace)
      Done. Took 1 ms
      Changes found

      Two issues here:

      1. If the job is triggered by a "Test Hook" call from GitHub and the slave is offline, it was always make a build job even if the there isn't any changes.
      2. (unconfirmed but very likely) The job would build even if the branch it is supposed to build isn't the one that was updated because of the "nonexisting_workspace" error.

      This could be resolved if all the tracking took place on the master node.

      Thank you for your consideration.

          [JENKINS-18079] GitHub Push always builds if workspace is on offline slave node

          Two years after is still reproducing. Is there any possibility to look at this bug? I'm working with docker-plugin starting slaves and is an ugly thing to launch a build of the same revision anytime a push is done to other branches.

          Xavier Morales added a comment - Two years after is still reproducing. Is there any possibility to look at this bug? I'm working with docker-plugin starting slaves and is an ugly thing to launch a build of the same revision anytime a push is done to other branches.

          Probably should be fixed with migration to notifyCommit (TODO)

          Kanstantsin Shautsou added a comment - Probably should be fixed with migration to notifyCommit (TODO)

          But first of all it's git-plugin issue.

          Kanstantsin Shautsou added a comment - But first of all it's git-plugin issue.

          Alex Gray added a comment -

          All of our builds run on temporarily slaves too, so we get bitten by this. It's horrible. Our hacky workaround is as follows:

          1. Have the build be done on the "master" node (since master is always online)
          2. Have a build step that triggers another job that gets executed on a "slave" node that actually does the build.
            It works because the master is always online and thus always the job's workspace. It's crappy because it takes 2 builds: 1 on the master, 1 on a slave. Oh, and make sure you pass in the git hash to the slave job, because someone can make a commit in between the time it takes launch the second build. Super crappy, but it's a lot better than have a bazilion needless builds being fired.

          Alex Gray added a comment - All of our builds run on temporarily slaves too, so we get bitten by this. It's horrible. Our hacky workaround is as follows: Have the build be done on the "master" node (since master is always online) Have a build step that triggers another job that gets executed on a "slave" node that actually does the build. It works because the master is always online and thus always the job's workspace. It's crappy because it takes 2 builds: 1 on the master, 1 on a slave. Oh, and make sure you pass in the git hash to the slave job, because someone can make a commit in between the time it takes launch the second build. Super crappy, but it's a lot better than have a bazilion needless builds being fired.

          My summary is the next:
          Nothing can be done with current trigger in github-plugin. Migration to notifyCommit is impossible and will break existed installations.
          github-plugin is generic and contains ancient push trigger that kicks git scm polling. That's why git scm runs offline builds.
          If you want to have other kind of triggers you can wrote separate plugin. I'm in process of writing native GH polling/triggering of builds without git poll under https://github.com/jenkinsci/github-integration-plugin

          Kanstantsin Shautsou added a comment - My summary is the next: Nothing can be done with current trigger in github-plugin. Migration to notifyCommit is impossible and will break existed installations. github-plugin is generic and contains ancient push trigger that kicks git scm polling. That's why git scm runs offline builds. If you want to have other kind of triggers you can wrote separate plugin. I'm in process of writing native GH polling/triggering of builds without git poll under https://github.com/jenkinsci/github-integration-plugin

          Kanstantsin Shautsou added a comment - - edited

          Works as designed, not a bug, closed.

          Kanstantsin Shautsou added a comment - - edited Works as designed, not a bug, closed.

          Does anyone have any workaround for this in 2016? I am using the ec2 plugin to stop the ec2 slave instance when idle to save on costs. However, builds are needlessly getting triggered by pushes to the github repo on branches that the jenkins job doesn't care about. The Jenkins job is only monitoring the master branch but because the workspace goes offline when idle, any push will trigger a build...integer I'd really appreciate if you could assist..

          Ebrahim Moshaya added a comment - Does anyone have any workaround for this in 2016? I am using the ec2 plugin to stop the ec2 slave instance when idle to save on costs. However, builds are needlessly getting triggered by pushes to the github repo on branches that the jenkins job doesn't care about. The Jenkins job is only monitoring the master branch but because the workspace goes offline when idle, any push will trigger a build... integer I'd really appreciate if you could assist..

          I just implemented branch trigger in https://github.com/KostyaSha/github-integration-plugin it doesn't require workspace.

          Kanstantsin Shautsou added a comment - I just implemented branch trigger in https://github.com/KostyaSha/github-integration-plugin it doesn't require workspace.

          wow integer this plugin looks promising. However, I just installed it and i'm struggling to understand how to use it as it's missing help documentation for the various fields. Do you know if this plugin provides a way to ignore pushes from certain users? We have a jenkinCI user that updates version and we want to be able to ignore pushes from that user.

          Ebrahim Moshaya added a comment - wow integer this plugin looks promising. However, I just installed it and i'm struggling to understand how to use it as it's missing help documentation for the various fields. Do you know if this plugin provides a way to ignore pushes from certain users? We have a jenkinCI user that updates version and we want to be able to ignore pushes from that user.

          Any other questions please fill to issues to not flood this thread.

          Kanstantsin Shautsou added a comment - Any other questions please fill to issues to not flood this thread.

            integer Kanstantsin Shautsou
            joekiller Joseph Lawson
            Votes:
            13 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: