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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: core, matrix-project-plugin
    • Labels:
      None
    • Environment:
      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)
    • Similar Issues:
    • Released As:
      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

            Hide
            j1mehta Jatin Mehta added a comment - - edited

            Devin Nusbaum, thank you for the reply. Makes sense, will do that. However, it will take some time since this problem occurs in a Jenkins environment of which I am not an admin and would need to replicate it locally. Meanwhile, if I could get any pointers, that would be great. 

            EDIT: It doesn't get reproduced right away. It starts occurring only after several builds and hence is kinda hard to reproduce.

            Show
            j1mehta Jatin Mehta added a comment - - edited Devin Nusbaum , thank you for the reply. Makes sense, will do that. However, it will take some time since this problem occurs in a Jenkins environment of which I am not an admin and would need to replicate it locally. Meanwhile, if I could get any pointers, that would be great.  EDIT: It doesn't get reproduced right away. It starts occurring only after several builds and hence is kinda hard to reproduce.
            Hide
            kamil02 Kamil Szuster added a comment -

            Jatin Mehta Devin Nusbaum I think we triggered this issue by removing the working directory of the job within the workspace of a node by hand. 

            Something like 

            1. Run job_a on node b
            2. let it finish
            3. login via ssh onto node b
            4. rm -R {JENKINS_WORKSPACE}/job_a
            5. rerun job a
            6. new folder with @2 suffix should be created

            Unfortunately i cant evaluate this right now.

            Show
            kamil02 Kamil Szuster added a comment - Jatin Mehta Devin Nusbaum I think we triggered this issue by removing the working directory of the job within the workspace of a node by hand.  Something like  Run job_a on node b let it finish login via ssh onto node b rm -R {JENKINS_WORKSPACE}/job_a rerun job a new folder with @2 suffix should be created Unfortunately i cant evaluate this right now.
            Hide
            j1mehta Jatin Mehta added a comment -

            Hi Kamil Szuster. I tried that too. With every new build, my Jenkinsfile removes the previous build's workspace.  Now, even if I remove the original workspace by hand, in the next build, it still goes on to create the workspace with an @2 suffix. Not sure if Jenkins caches the data (that a workspace xyz was present once upon a time on this node) using which it creates the new workspace (xyz@2)

            Show
            j1mehta Jatin Mehta added a comment - Hi Kamil Szuster . I tried that too. With every new build, my Jenkinsfile removes the previous build's workspace.  Now, even if I remove the original workspace by hand, in the next build, it still goes on to create the workspace with an @2 suffix. Not sure if Jenkins caches the data (that a workspace xyz was present once upon a time on this node) using which it creates the new workspace (xyz@2)
            Hide
            kamil02 Kamil Szuster added a comment -

            Jatin Mehta did you also try to restart the jenkins master after the deletion of both (original and @2) workspaces? If i remember correctly, i also had the feeling, that jenkins uses some kind of cache to remember where the workspace is supposed to be. As mentioned before, restarting the jenkins master instance after deleting the original and @2 workspace solved our problem.

            Show
            kamil02 Kamil Szuster added a comment - Jatin Mehta did you also try to restart the jenkins master after the deletion of both (original and @2) workspaces? If i remember correctly, i also had the feeling, that jenkins uses some kind of cache to remember where the workspace is supposed to be. As mentioned before, restarting the jenkins master instance after deleting the original and @2 workspace solved our problem.
            Hide
            j1mehta Jatin Mehta added a comment - - edited

            Kamil Szuster, I don't have admin access to restart Jenkins master. Besides, thats only a temporary workaround. If this was a permanent solution, it shouldn't have cropped up for a new project (or same project with its name changed for that matter). It is still a bug. Will try to come up with a more consistent way to produce it. 

            Show
            j1mehta Jatin Mehta added a comment - - edited Kamil Szuster , I don't have admin access to restart Jenkins master. Besides, thats only a temporary workaround. If this was a permanent solution, it shouldn't have cropped up for a new project (or same project with its name changed for that matter). It is still a bug. Will try to come up with a more consistent way to produce it. 

              People

              • Assignee:
                dnusbaum Devin Nusbaum
                Reporter:
                totoroliu Rick Liu
              • Votes:
                4 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: