Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1288

classes promises should not be reevaluated needlessly (persistent and non-persistent)

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.1
    • Component/s: Evaluation
    • Labels:
      None

      Description

      Requested by customer.

      Take this example:

      @classes: "x" expression => returnszero("COMMAND");@

      when @x@ is evaluated and set, there is no need to call @COMMAND@ again, yet we call it at least twice per agent run (regardless of whether @x@ is persistent or not). This can be avoided with just

      @classes: !x:: "x" expression => returnszero("COMMAND");@

      but it's tedious to guard every class. I propose to add this guard automatically to every classes promise that calls a system function, at least when @cache_system_functions@ is set.

      This should work for persistent classes too.

      Target version and priority TBD.

        Attachments

          Release management

            Issue Links

              Activity

                People

                Assignee:
                a10025 Volker Hilsheimer (Inactive)
                Reporter:
                jiraadmin Old User (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: