From 1e1e44050a5f33c54c874973c8a165d43312fa5c Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Mon, 12 Apr 2021 10:02:13 +0200 Subject: [PATCH 2/2] Less scary "action enabler dropped" logging. Inform the user that multiple copies of the original enabler may be created while hard obligatory requirements are added and that the enabler being dropped because of a self contradiction may be one of multiple copies of the original. Demote the log level of the message when an enabler is dropped because of a self contradiction to warn. As multiple copies are created when there is more than one potential solution a self contradiction currently only indicates a potential error. Thanks to Marko Lindqvist for feed back on the solution. Reported by Marko Lindqvist See osdn #41971 --- server/rscompat.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/server/rscompat.c b/server/rscompat.c index 8b8b52ae34..04a590bb8c 100644 --- a/server/rscompat.c +++ b/server/rscompat.c @@ -179,10 +179,10 @@ rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae) * because the action it self would have blocked it. In that case * this is an error. */ - log_error("While adding hard obligatory reqs to action enabler" - " for %s: %s" - " Dropping it.", - action_rule_name(paction), problem->description); + log_warn("While adding hard obligatory reqs to action enabler" + " for %s: %s" + " Dropping it.", + action_rule_name(paction), problem->description); ae->disabled = TRUE; req_vec_problem_free(problem); return TRUE; @@ -249,6 +249,16 @@ rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae) **************************************************************************/ void rscompat_enablers_add_obligatory_hard_reqs(void) { + log_normal("action enablers: adding obligatory hard requirements."); + log_warn("More than one way to fulfill a new obligatory hard requirement" + " may exist." + " In that case the enabler is copied so each alternative" + " solution is applied to a copy of the enabler." + " If an action enabler becomes self contradicting after applying" + " a solution it is dropped." + " Note that other copies of the original enabler may have" + " survived even if one copy is dropped."); + action_iterate(act_id) { bool restart_enablers_for_action; do { -- 2.30.2