Details
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 $