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

log_repaired log_string causes changing promise hashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 3.15.1, 3.15.2
    • Fix Version/s: 3.16.0, 3.15.3
    • Component/s: None
    • Labels:
      None

      Description

      If you use action => log_repaired from standard library, locking does not work as expected. It causes every evaluation to get a different lock (different promise hash).

      Reproducer:

      body file control
      # Import the standard library
      # For body edit_line insert_lines
      {
        inputs => { "$(sys.libdir)/stdlib.cf" };
      }
      
      bundle agent main
      {
        files:
          any::
            "/tmp/text"
              create => "true",
              action => log_repaired("/var/log/cfengine/repaired.log", "bundle $(this.bundle), promise $(this.promiser) repaired in $(this.promise_filename) at line $(this.promise_linenumber).");
      }
      
      root@OH-WIN core $ cf-check dump /var/cfengine/state/cf_lock.lmdb | grep last | wc -l
      9
      root@OH-WIN core $ cf-agent -I test.cf
      root@OH-WIN core $ cf-check dump /var/cfengine/state/cf_lock.lmdb | grep last | wc -l
      12
      root@OH-WIN core $ cf-agent -I test.cf
      root@OH-WIN core $ cf-check dump /var/cfengine/state/cf_lock.lmdb | grep last | wc -l
      15
      root@OH-WIN core $ cf-agent -I test.cf
      root@OH-WIN core $ cf-check dump /var/cfengine/state/cf_lock.lmdb | grep last | wc -l
      18
      root@OH-WIN core $
      

        Attachments

          Activity

            People

            • Assignee:
              olehermanse Ole Herman Schumacher Elgesem
              Reporter:
              olehermanse Ole Herman Schumacher Elgesem
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel