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

TFS plugin: Can't reuse workspace and 100% CPU

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: tfs-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.190.3 Windows installer
      All plugins recommended by installer + MSBuild Plugin + TFS Plugin
      Java version included with Windows installer
      Windows Server 2016
    • Similar Issues:

      Description

      I installed a fresh installation of Jenkins 2.190.3 using the Windows installer. All of the recommended plugins in the installer were installed, then I selected to install the MSBuild Plugin 1.29 and the TFS Plugin 5.157.0.

      I am accessing an on-prem TFS 2015 server. I configured the TFS plugin with the account credentials. The connection to TFS is working because the source code can be downloaded.

      I created a new Jenkins job and pointed it at my Jenkins file in TFS. The Jenkinsfile contains a single stage with a single line of "checkout scm".

      When I run the Jenkins job the CPU goes up to 99% making the server very slow. After 15 minutes it will eventually complete and the source code that I expect is in the Jenkins workspace.

      There are a few problems that may be related:

      The job log shows a message that says: "Lightweight checkout support not available". I checked the box on the project settings for Lightweight checkout. Maybe lightweight checkout isn't available on TFS2015?

      The logs show that a workspace was created to get the Jenkinsfile that I specified. Then in the next section of the log it goes on to download all of the files again. There is a message that says, "Although the server things the workspace exists, no mapping was found". It then recreates the workspace and has to download all the files again. After the job is complete I open a command prompt and go to the directory and I confirm that there is no TFS workspace there. I have the "Use Update" option in the advanced TFS sections checked, so it should be reusing the workspace. I can't figure out what is deleting the workspace, it is not shown in the logs.

      Why does the CPU go to 100% when pulling the files down. This makes the server mostly unusable during that time. In the process list I see a Java process is taking up all the CPU, but I'm not sure how to get further info on exactly what is causing it.

       

        Attachments

          Activity

          Hide
          smd Stefan Drissen added a comment -

          I was testing with a pipeline script in the job configuration without using the Jenkinsfile from scm and had everything working fine. My next step was to use the Jenkinsfile directly from scm and then I ran into this same "interesting" behavior of the tfs plugin.

          To work-around the absence of the lightweight checkout (our branch has 24 000 files totaling 1 GB) I have cloaked all but the branch folder, added the option skipDefaultCheckout true to the pipeline and then do the actual checkout in a stage:

          pipeline {
          
             options {
                skipDefaultCheckout true
             }
          
             stages {
          
                stage( 'pre-build' ) {
          
                   agent {
                      label 'master'
                   }
                   steps {
          
                      checkout(
                         [
                            $class: 'TeamFoundationServerScm',
                            credentialsConfigurer: [$class: 'AutomaticCredentialsConfigurer'],
                            serverUrl: 'https://<collection>',
                            projectPath: "${branch}",
                            localPath: 'tfs',
                            useOverwrite: true,
                            useUpdate: true,
                            workspaceName: "Jenkins-${JOB_BASE_NAME}-tfs"
                         ]
                      )
                      dir( 'tfs' ) {
          
          

           

           

          Show
          smd Stefan Drissen added a comment - I was testing with a pipeline script in the job configuration without using the Jenkinsfile from scm and had everything working fine. My next step was to use the Jenkinsfile directly from scm and then I ran into this same "interesting" behavior of the tfs plugin. To work-around the absence of the lightweight checkout (our branch has 24 000 files totaling 1 GB) I have cloaked all but the branch folder, added the option skipDefaultCheckout true to the pipeline and then do the actual checkout in a stage: pipeline { options { skipDefaultCheckout true } stages { stage( 'pre-build' ) { agent { label 'master' } steps { checkout( [ $class: 'TeamFoundationServerScm' , credentialsConfigurer: [$class: 'AutomaticCredentialsConfigurer' ], serverUrl: 'https: //<collection>' , projectPath: "${branch}" , localPath: 'tfs' , useOverwrite: true , useUpdate: true , workspaceName: "Jenkins-${JOB_BASE_NAME}-tfs" ] ) dir( 'tfs' ) {    

            People

            • Assignee:
              redsolo redsolo
              Reporter:
              radium Patrick Sheedy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: