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

make it possible to limit heavy function calls to the first invocation

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Built-in functions
    • Labels:
      None

      Description

      Right now, it seems that functions are called repeatedly by the convergence engine even if they evaluate correctly.

      This is not desirable for heavy (side-effect) functions, e.g. calling @/usr/bin/curl@ on a remote URL. In general we agreed in discussion that any function should be run only until it returns success. Feedback welcome.

      The acceptance test for #2981 in https://github.com/cfengine/core/pull/974 will test this as well, so a new acceptance test is not necessary.

      Plan of action:

      • tag @execresult@, @returnszero@, and @usemodule@ as "expensive system functions we want to cache" (some kind of enum replacing the variadic flag)
      • add global option to control expensive function caching, defaulting to true: @ body common control { cache_system_functions => "false/true" }

        @

      • implement caching behavior
      • extend caching tags to other functions as needed

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel