Skip to content

ENT-13720: Suppress spurious validation error log on SIGTERM#6133

Merged
larsewi merged 1 commit into
cfengine:masterfrom
larsewi:ENT-13720-validation-error-log-on-sigterm
May 19, 2026
Merged

ENT-13720: Suppress spurious validation error log on SIGTERM#6133
larsewi merged 1 commit into
cfengine:masterfrom
larsewi:ENT-13720-validation-error-log-on-sigterm

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.

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>
@larsewi
Copy link
Copy Markdown
Contributor Author

larsewi commented May 19, 2026

@cf-bottom Jenkins please :)

@larsewi larsewi requested a review from craigcomstock May 19, 2026 07:43
@cf-bottom
Copy link
Copy Markdown

@larsewi
Copy link
Copy Markdown
Contributor Author

larsewi commented May 19, 2026

^ The valgrind-checks failure above is a different issue. The container probably does not have an smtp server. Hence:

error: Mail report: couldn't connect to host 'localhost'. (connect: Connection refused)

Will open a separate PR to run smtp-sink on the container

@larsewi larsewi merged commit c95fd37 into cfengine:master May 19, 2026
42 of 43 checks passed
@larsewi larsewi deleted the ENT-13720-validation-error-log-on-sigterm branch May 19, 2026 17:20
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.

3 participants