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

Build creates second workspace@2 for non-concurrent build configuration

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Duplicate
    • core, matrix-project-plugin
    • None
    • OS: Ubuntu 12.04 64-bit
      Jenkins: 1.609.1 (upgraded from 1.580.3)
      disk-usage plugin: 0.25 (upgraded from 0.24)
      Matrix Project Plugin: 1.6 (upgraded from 1.4.1)
    • Jenkins Core 2.136

    Description

      I didn't have this issue when I was using ver 1.580.3.
      After upgrading Jenkins ver 1.609.1 (together with other Jenkins plugins update),
      I started to see this issue.

      My jenkins job is using multi-config project type (aka Matrix project),
      and has 3 variants.
      I didn't set to be run concurrently,
      so the 3 variants will start the build one by one.

      In the previous version 1.580.3,
      it will reuse the same workspace folder for all of 3 variant builds.

      In the new version 1.609.1,
      when multiple jobs are triggerd,
      I can see sometimes the first variant build of the second job
      will start to create and use workspace@2
      instead of re-using original worksapce.

      Note:
      I'm also using disk-usage plugin.
      At the end of build,
      it will trigger that plugin to calculate workspace disk space.
      My work space tends to be large and sometimes it take several minutes to finish.

      I suspect it's that disk-usage plugin still occupying the original worksapce,
      but the second job in queue starts earlier,
      so it creates workspace@2 for the first variable build.

      From workspace@2,
      I always see only one variant only under AXIS folder.

      Attachments

        Issue Links

          Activity

            olssons Sten Olsson added a comment -

            I also have this problem.  I checkout two repositories into my workspace and often times Jenkins creates a second workspace for the parallel-running job which checks out the second repo.  The tools assume they are in the same workspace and promptly fail.  Possible workaround might be to save the location of WORKSPACE in the beginning and then with each parallel task, always change directory (cd) back to that location before doing anything. 

            For example,

            olssons Sten Olsson added a comment - I also have this problem.  I checkout two repositories into my workspace and often times Jenkins creates a second workspace for the parallel-running job which checks out the second repo.  The tools assume they are in the same workspace and promptly fail.  Possible workaround might be to save the location of WORKSPACE in the beginning and then with each parallel task, always change directory (cd) back to that location before doing anything.  For example,
            olssons Sten Olsson added a comment -

            dnusbaum - I see that the issue is marked as Resolved.  In this case, should a new issue be created or the preference is to Reopen?  I didn't want to reopen if it really needs to be a new issue instead.

            olssons Sten Olsson added a comment - dnusbaum - I see that the issue is marked as Resolved.  In this case, should a new issue be created or the preference is to Reopen?  I didn't want to reopen if it really needs to be a new issue instead.
            dnusbaum Devin Nusbaum added a comment -

            olssons My guess is that there are probably many distinct issues being reported here (e.g. some scenarios are likely specific to (multibranch) pipelines, but there were also bugs fixed that affected freestyle and other project types). I would go ahead and open a new issue with full details on your specific case, ideally with steps on how to reproduce the problem from scratch.

            dnusbaum Devin Nusbaum added a comment - olssons My guess is that there are probably many distinct issues being reported here (e.g. some scenarios are likely specific to (multibranch) pipelines, but there were also bugs fixed that affected freestyle and other project types). I would go ahead and open a new issue with full details on your specific case, ideally with steps on how to reproduce the problem from scratch.
            olssons Sten Olsson added a comment -

            dnusbaum - With my issue, the double workspace never occurs during the "Build Software" parallel tasks.  However, when I have 3 parallel tasks in a row, like under "Analysis and Adaptation", this is where the problem sometimes happens.  I say sometimes because it happens maybe half the time or 3 out of 4 builds in a row. 

            I first started my workarounds by removing the second checkout like I mentioned before (see "Checkout tools" above).  That did not fix the problem.  I then made all the tasks in Analysis and Adaptation serial.  That (obviously) fixed the problem.  If I were to guess, it didn't like 3 tasks running in parallel, all using the same workspace.  My builds take about 10-15 minutes longer now, but no more failures at least.

            I may open an issue in the future. 

            PS - I could never recreate the problem from the Jenkins Pipeline script, only from a checked in Jenkinsfile itself

            olssons Sten Olsson added a comment - dnusbaum - With my issue, the double workspace never occurs during the "Build Software" parallel tasks.  However, when I have 3 parallel tasks in a row, like under "Analysis and Adaptation", this is where the problem sometimes happens.  I say sometimes because it happens maybe half the time or 3 out of 4 builds in a row.  I first started my workarounds by removing the second checkout like I mentioned before (see "Checkout tools" above).  That did not fix the problem.  I then made all the tasks in Analysis and Adaptation serial.  That (obviously) fixed the problem.  If I were to guess, it didn't like 3 tasks running in parallel, all using the same workspace.  My builds take about 10-15 minutes longer now, but no more failures at least. I may open an issue in the future.  PS - I could never recreate the problem from the Jenkins Pipeline script, only from a checked in Jenkinsfile itself
            wizzzozzz Ori Wiesel added a comment -

            Is there anyway to disable this option?

            so no new workspace will be created and only the original workspace will be used alone? (I'm aware of the risks)

            wizzzozzz Ori Wiesel added a comment - Is there anyway to disable this option? so no new workspace will be created and only the original workspace will be used alone? (I'm aware of the risks)

            People

              dnusbaum Devin Nusbaum
              totoroliu Rick Liu
              Votes:
              4 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: