Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-10713

Fine grained environment timeout issues

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 7.1.0, PUP 6.20.0
    • Component/s: None
    • Labels:
    • Template:
      PUP Bug Template
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Previously, if the environment.conf for an environment was updated and the environment was cleared, then puppetserver would still use the old values in memory for per-environment settings such as modulepath, config_version, etc. This was true if the environment timed out or if the environment was explicitly cleared using puppetserver's environment cache REST API.

      Now if an environment is cleared, puppet will reload the per-environment settings from the updated environment.conf.
      Show
      Previously, if the environment.conf for an environment was updated and the environment was cleared, then puppetserver would still use the old values in memory for per-environment settings such as modulepath, config_version, etc. This was true if the environment timed out or if the environment was explicitly cleared using puppetserver's environment cache REST API. Now if an environment is cleared, puppet will reload the per-environment settings from the updated environment.conf.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet's environment cache has three methods for evicting a single expired environment, all expired environments, or all environments, but they don't mutate the cache in a consistent way:

      1. Whenever Puppet::Environments::Cached#get_conf(name) is called to lookup the EnvironmentConf for an environment, we clear that environment if it is now expired via evict_if_expired(name), but the method doesn't update the @next_expiration instance variable. As a result, the optimization in clear_all_evicted may cause us to call the cache_expiration_service.expired?(name.to_sym twice.

      2. Whenever Puppet::Environments::Cached#get(name) is called, we clear all environments that are now expired via clear_all_expired. This method updates the cache consistently.

      3. Whenever Puppet::Environments::Cached#clear_all is called, the cache_expiration_service is never notified of the eviction, which could lead to puppetserver holding onto environment names in memory. The method also does not clear environment related settings (for each environment). So anyone calling `Puppet[:rich_data]` for example could "see" the value from the now evicted environment. The clear_all method is used when Puppet[:rich_data] is set and also in unit tests.

      4. The Puppet::Environments::Cached#clear method does not remove the environment entry from the @expirations sorted set and doesn't recalculate the @next_expiration time, or clear the enviroment related settings. The clear methods does not appear to be used in puppet, as it was decided earlier to only support a REST API for cache eviction.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              josh Josh Cooper
              Reporter:
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support