Skip to content

ENT-3868: Improved persistent class logging and plugged memory leak#6158

Merged
nickanderson merged 2 commits into
cfengine:masterfrom
nickanderson:ENT-3868/master
Jun 4, 2026
Merged

ENT-3868: Improved persistent class logging and plugged memory leak#6158
nickanderson merged 2 commits into
cfengine:masterfrom
nickanderson:ENT-3868/master

Conversation

@nickanderson
Copy link
Copy Markdown
Member

@nickanderson nickanderson commented Jun 4, 2026

This change makes it easier to see when a persistent class timer is being reset. It highlighted a gap in classes promises, they are not able to specify the timer_policy, the ability to specify timer_policy is currently only available in classes bodies. Thus, currently, classes promises always cause a timer reset.

Ticket: ENT-3868

existing_info was allocated via xcalloc but never freed on the
early-return (preserve) path, the early-return (read error) path,
or the normal fall-through path.
Replace the generic "Updating persistent class" verbose message with
context-aware messages that distinguish between:

- Creating a new persistent class (no prior DB record)
- Resetting a timer (existing record, policy=reset)
- Updating a preserved class (tags changed or class expired)

This makes it easier to diagnose persistent class timer behavior from
verbose logs without needing to add custom debugging builds.

Ticket: ENT-3868
Changelog: Title
@nickanderson nickanderson changed the title Improved persistent class logging and plugged memory leak ENT-3933: Improved persistent class logging and plugged memory leak Jun 4, 2026
Copy link
Copy Markdown
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable enough. How did you see the memory issue? Might be useful information for that commit.

@nickanderson
Copy link
Copy Markdown
Member Author

seems reasonable enough. How did you see the memory issue? Might be useful information for that commit.

LLM pointed it out to me wile I was looking for these logs.

@nickanderson nickanderson merged commit afabfbc into cfengine:master Jun 4, 2026
11 checks passed
@nickanderson nickanderson changed the title ENT-3933: Improved persistent class logging and plugged memory leak ENT-3868: Improved persistent class logging and plugged memory leak Jun 4, 2026
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