Skip to content

ENT-13720: Suppress spurious validation error log on SIGTERM (3.24.x)#6135

Merged
larsewi merged 1 commit into
cfengine:3.24.xfrom
larsewi:error-log-on-sigterm-3.24.x
May 19, 2026
Merged

ENT-13720: Suppress spurious validation error log on SIGTERM (3.24.x)#6135
larsewi merged 1 commit into
cfengine:3.24.xfrom
larsewi:error-log-on-sigterm-3.24.x

Conversation

@larsewi
Copy link
Copy Markdown
Contributor

@larsewi larsewi commented May 19, 2026

During shutdown, the polling loop in ShellCommandReturnsZero (added in ec2627e) aborts the cf-promises child and returns false. The caller GenericAgentArePromisesValid could not distinguish this from a real validation failure and logged Policy failed validation with command '...' at LOG_LEVEL_ERR.

The valgrind CI's check_daemon_output greps the daemon stdout for error and fails on this otherwise harmless shutdown message (see valgrind-checks job #303).

Now check IsPendingTermination() at the call site and downgrade to LOG_LEVEL_VERBOSE when we aborted because the daemon is shutting down. Real validation failures keep their original error log.

Backported from #6133

Build Status

When a daemon aborts cf-promises during shutdown,
ShellCommandReturnsZero() returns false. Skip the
"Policy failed validation" error log in that case so it
doesn't pollute daemon output (and fail valgrind CI).

Ticket: ENT-13720
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 9e499ed)
@larsewi larsewi marked this pull request as draft May 19, 2026 08:39
@larsewi larsewi marked this pull request as ready for review May 19, 2026 09:02
@larsewi larsewi merged commit fe1e49c into cfengine:3.24.x May 19, 2026
44 checks passed
@larsewi larsewi deleted the error-log-on-sigterm-3.24.x branch May 19, 2026 17:21
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.

1 participant