CFE-4681: Add timer_policy to classes: promise type#6160
Closed
nickanderson wants to merge 1 commit into
Closed
Conversation
The timer_policy attribute (absolute vs reset) was available in classes bodies (outcome classes on other promise types) but missing from classes: type promises. As a result, VerifyClassPromise hardcoded CONTEXT_STATE_POLICY_RESET and persistent classes defined via classes: promises always reset their timer with no way to opt into preserve (absolute) behavior. - Add timer_policy option to CF_CLASSBODY syntax (mod_common.c) - Add PersistentClassPolicy timer field to ContextConstraint (cf3.defs.h) - Parse timer_policy in GetContextConstraints (attributes.c) - Pass parsed policy instead of hardcoded RESET (verify_classes.c) - Add unit test for persistent class timer policy behavior - Add acceptance test for timer_policy on classes: promises Ticket: CFE-4681 Changelog: Title
61fe2a7 to
855f3e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
timer_policyattribute support toclasses:type promisestimer_policywas only available inclassesbodies (outcome classes on other promise types)VerifyClassPromisehardcodedCONTEXT_STATE_POLICY_RESET, so persistent classes defined viaclasses:promises always reset their timer with no way to use absolute/preserve behaviorExample
Changes
libpromises/cf3.defs.hPersistentClassPolicy timerfield toContextConstraintstructlibpromises/mod_common.ctimer_policyoption toCF_CLASSBODYsyntax arraylibpromises/attributes.ctimer_policyinGetContextConstraints(), add to expression-loop skip listlibpromises/verify_classes.cCONTEXT_STATE_POLICY_RESETwitha.context.timerDefault behavior is unchanged — when
timer_policyis absent, it defaults toreset.Ticket
CFE-4681