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

VSphereCloudRetentionStrategy idleMinutes not persistent

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: vsphere-cloud-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.71
      vsphere-cloud-plugin 2.15
    • Similar Issues:

      Description

      Steps to reproduce

      1. Setup Environment
        1. Install the Jenkins vSphere Cloud Plugin
        2. Configure a vSphere Cloud Template
          1. Select the “vSphere Keep-Until-Idle” Retention Strategy and set the Idle Timeout to 10 minutes.
        3. Verify that you can successfully deploy a test node.
      2. Premature Node Termination (problem)
        1. Restart Jenkins. Do NOT go to the configuration page afterwards.
        2. Run a job using a dynamically deployed cloud slave.
        3. When the job completes, observe that the dynamic slave is terminated on the first retention strategy check (within a few minutes), despite not having been idle for the configured idle timeout.
      3. Normal Node Termination (workaround)
        1. Go to the Jenkins configuration page and Save. No other changes are necessary.
        2. Run a job using a dynamically deployed cloud slave.
        3. When the job completes, observe that the dynamic slave is terminated in accordance with the configured idle timeout.

       

      Possible Cause

      Both the VSphereCloudRetentionStrategy and its superclass CloudRetentionStrategy define a private int ‘idleMinutes’ field.  This seems to cause CloudRetentionStrategy’s field to not be properly stored and/or restored when Jenkins is restarted.

      Possible Resolution

      Renaming the field in VSphereCloudRetentionStrategy seems to resolve the problem.  The configuration will need to be saved once after the updated plugin is installed.

        Attachments

          Activity

          Hide
          balleman Brady Alleman added a comment -
          Show
          balleman Brady Alleman added a comment - Potential solution:  https://github.com/jenkinsci/vsphere-cloud-plugin/pull/80
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Brady Alleman
          Path:
          src/main/java/org/jenkinsci/plugins/vsphere/VSphereCloudRetentionStrategy.java
          http://jenkins-ci.org/commit/vsphere-cloud-plugin/f15f5f9a8d12c3826e4856ba4b5c04c804bac7d0
          Log:
          [FIXED JENKINS-45786] Add readResolve() to VSphereCloudRetentionStrategy
          to ensure super.idleMinutes is properly restored from persistent state

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Brady Alleman Path: src/main/java/org/jenkinsci/plugins/vsphere/VSphereCloudRetentionStrategy.java http://jenkins-ci.org/commit/vsphere-cloud-plugin/f15f5f9a8d12c3826e4856ba4b5c04c804bac7d0 Log: [FIXED JENKINS-45786] Add readResolve() to VSphereCloudRetentionStrategy to ensure super.idleMinutes is properly restored from persistent state
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Peter Darton
          Path:
          src/main/java/org/jenkinsci/plugins/vsphere/VSphereCloudRetentionStrategy.java
          http://jenkins-ci.org/commit/vsphere-cloud-plugin/bbdd06299c044415ca5eaa61fb60df2cf7d2ab51
          Log:
          Merge pull request #82 from balleman/vscrs_readresolve

          [FIXED JENKINS-45786] Add readResolve() to VSphereCloudRetentionStrategy

          Compare: https://github.com/jenkinsci/vsphere-cloud-plugin/compare/f3c7aacec91b...bbdd06299c04

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Peter Darton Path: src/main/java/org/jenkinsci/plugins/vsphere/VSphereCloudRetentionStrategy.java http://jenkins-ci.org/commit/vsphere-cloud-plugin/bbdd06299c044415ca5eaa61fb60df2cf7d2ab51 Log: Merge pull request #82 from balleman/vscrs_readresolve [FIXED JENKINS-45786] Add readResolve() to VSphereCloudRetentionStrategy Compare: https://github.com/jenkinsci/vsphere-cloud-plugin/compare/f3c7aacec91b...bbdd06299c04
          Hide
          pjdarton pjdarton added a comment -

          Code changes merged.  Fixed in version 2.16.

          Show
          pjdarton pjdarton added a comment - Code changes merged.  Fixed in version 2.16.

            People

            • Assignee:
              Unassigned
              Reporter:
              balleman Brady Alleman
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: