Skip to content

CFE-4681: timer_policy support for classes: promise (3.24)#6180

Open
nickanderson wants to merge 3 commits into
cfengine:3.24.xfrom
nickanderson:CFE-4681/3.24.x
Open

CFE-4681: timer_policy support for classes: promise (3.24)#6180
nickanderson wants to merge 3 commits into
cfengine:3.24.xfrom
nickanderson:CFE-4681/3.24.x

Conversation

@nickanderson

Copy link
Copy Markdown
Member

No description provided.

nickanderson and others added 3 commits June 15, 2026 09:47
…ntSave

ValueSizeDB() was called with strlen(key), but WriteDB(), ReadDB() and
DeleteDB() store and look up keys with strlen(key) + 1 (including the
terminating NUL), and LMDB matches keys by exact byte length. The lookup
therefore never found the stored record and always reported size 0.

Passing strlen(key) + 1 makes the lookup match the key as written. This
lets EvalContextHeapPersistentSave() find an existing record and act on
it: preserve an already-set, unexpired timer (CONTEXT_STATE_POLICY_PRESERVE)
and log "Resetting" rather than "Creating" on a RESET save.

Ticket: CFE-4681
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit c90ccba)
Add a timer_policy attribute to classes: promises, controlling whether a
persistent class timer resets on re-evaluation ("reset") or preserves the
original expiry ("absolute"). Defaults to "absolute" for backward
compatibility; planned to change to "reset" in 3.28.0 to match classes
bodies, keeping "absolute" on the 3.24 and 3.27 LTS backports.

timer_policy without persistence is now an error, since it only governs
the persistence timer.

Ticket: CFE-4681
Changelog: Title
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 53afadc)
The new timer_policy tests referenced ../../default.sub.cf (the master
filename); on 3.24.x the harness file is default.cf.sub. Correct the
include so cf-promises can validate the policy instead of falling to
failsafe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nickanderson

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins, please

@cf-bottom

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants