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

Setting a custom workspace for a matrix build results in checkout failures on the parent when the job runs

      Currently it is possible to set a custom workspace for a matrix build.

      However, all matrix builds run a "parent" job which checks out the source code (even though it doesn't seem to use it at all) and this parent job will happily run concurrently with another job using the same workspace.

      This means that when a matrix build runs, if the machine it's running on is already running another job which uses the same custom workspace, the second build will automatically fail, because it can't check out from source control.

      The workaround is pretty simple: don't set a custom workspace - make sure all your matrix builds use a dedicated workspace.

      Potential fixes:

      A. Prohibit setting a custom workspace when the build is a matrix build. If it hadn't been possible to set it, we wouldn't have hit the problem and wasted a day trying to figure out why our checkouts weren't working only on these builds. I guess this is not a perfect solution though - we were using the custom workspace feature as a means of reducing disk space, and being forced to turn it off for matrix builds is not great.

      B. If two projects are running at the same time on the same host, bump the workspace name for the second one ("common" -> "common2" or similar) so that the second project doesn't immediately fail the checkout.

      C. Stop the parent node from checking out the code at all. This is my preference, as it doesn't seem to be using the code anyway and is only causing an issue getting builds to work.

          [JENKINS-20847] Setting a custom workspace for a matrix build results in checkout failures on the parent when the job runs

          There are no comments yet on this issue.

            Unassigned Unassigned
            trejkaz trejkaz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: