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

Loading node environment variables takes a long time for first build on a slave

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • envinject-plugin
    • None
    • Jenkins master 1.651.2 running in JBoss EAP 6.4.7 on Java 8 on Linux (Centos 6.7).
      Slave is Windows Server 2008r2 running in AWS, launched via the ec2 plugin.

      We have a use case where we frequently dynamically create slaves to run certain jobs.

      We've noticed that the first time a job is run on a new slave node, the "Loading node environment variables." step takes a very long time (~4-5 minutes).

      Using the timestamper plugin, we obtained the following logs:

      First run:

      20:06:54 Started by user Daniel
      20:06:54 [EnvInject] - Loading node environment variables.
      20:11:26 [EnvInject] - Preparing an environment for the build.
      20:11:26 [EnvInject] - Keeping Jenkins system variables.
      20:11:30 [EnvInject] - Keeping Jenkins build variables.
      20:11:57 [EnvInject] - Injecting as environment variables the properties content 
      20:11:57 TESTCOMPLETE_PLUGIN_DEBUG=true
      20:11:57 
      20:11:57 [EnvInject] - Variables injected successfully.
      20:11:57 [EnvInject] - Injecting contributions.
      20:11:57 Building remotely on Windows Server 2008 TestComplete (i-0a5791d0) (testcomplete) in workspace c:\jenkins\workspace\testcomplete_Create_VM
      

      Second run on same slave:

      20:22:18 Started by user Daniel
      20:22:18 [EnvInject] - Loading node environment variables.
      20:22:20 [EnvInject] - Preparing an environment for the build.
      20:22:20 [EnvInject] - Keeping Jenkins system variables.
      20:22:20 [EnvInject] - Keeping Jenkins build variables.
      20:22:21 [EnvInject] - Injecting as environment variables the properties content 
      20:22:21 TESTCOMPLETE_PLUGIN_DEBUG=true
      20:22:21 
      20:22:21 [EnvInject] - Variables injected successfully.
      20:22:21 [EnvInject] - Injecting contributions.
      20:22:21 Building remotely on Windows Server 2008 TestComplete (i-0a5791d0) (testcomplete) in workspace c:\jenkins\workspace\testcomplete_Create_VM
      

      There's another ~30s delay in "Keeping Jenkins build variables.", which also seems long a long time.

      There doesn't appear to be any CPU contention or anything of that nature going on that I can see.

      Any ideas what could be causing the delay?
      How would you recommend debugging it?

            oleg_nenashev Oleg Nenashev
            datallah Daniel Atallah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: