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

EnvActionImpl.ownerEnvironment cache never gets invalidated

      Once env.PROP is evaluated, or DefaultStepContext loads environment variables, EnvActionImpl.getEnvironment caches ownerEnvironment and will not call Run.getEnvironment again for the same build. This means that an EnvironmentContributor which, for example, pays attention to an Action that might be added during the build will not have a visible effect.

      Removing the cache is easy, but there is some performance implication.

          [JENKINS-42499] EnvActionImpl.ownerEnvironment cache never gets invalidated

          Jesse Glick added a comment -

          Possible ways to keep the cache in most cases:

          • key it by Run.actions, since typically a change in actions would the reason for a change in variables
          • invalidate it upon access to undefined variable, since typically changes involve adding new variables, rather than modifying existing ones

          Jesse Glick added a comment - Possible ways to keep the cache in most cases: key it by Run.actions , since typically a change in actions would the reason for a change in variables invalidate it upon access to undefined variable, since typically changes involve adding new variables, rather than modifying existing ones

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/DynamicEnvironmentExpanderTest.java
          http://jenkins-ci.org/commit/workflow-cps-plugin/c7927ad10625904570cf9a80f2e7d8bcb03573cb
          Log:
          JENKINS-42499 Testing the fix.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/org/jenkinsci/plugins/workflow/DynamicEnvironmentExpanderTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/c7927ad10625904570cf9a80f2e7d8bcb03573cb Log: JENKINS-42499 Testing the fix.

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/cps/EnvActionImpl.java
          src/test/java/org/jenkinsci/plugins/workflow/DynamicEnvironmentExpanderTest.java
          http://jenkins-ci.org/commit/workflow-cps-plugin/c099e48a8ddf9c0b38b1957e13a1561e6fb779dc
          Log:
          Merge pull request #106 from jglick/EnvActionImpl-cache

          JENKINS-42499 Removing caching from EnvActionImpl

          Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/616e3ada5197...c099e48a8ddf

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/cps/EnvActionImpl.java src/test/java/org/jenkinsci/plugins/workflow/DynamicEnvironmentExpanderTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/c099e48a8ddf9c0b38b1957e13a1561e6fb779dc Log: Merge pull request #106 from jglick/EnvActionImpl-cache JENKINS-42499 Removing caching from EnvActionImpl Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/616e3ada5197...c099e48a8ddf

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: