Bug #23073
closed
If a change is made while a policy generation is running, it does not always trigger a new policy generation when needed
Added by Félix DALLIDET over 1 year ago.
Updated over 1 year ago.
Category:
Web - Config management
Severity:
Major - prevents use of part of Rudder | no simple workaround
Description
It seems like if a policy generation is already running, when saving an element which will modify the current conf state will not automatically trigger a new policy generation after the one already running.
It can be observed in the event logs page where saving a rule impacting nodes, while a policy generation is running does not create a new event of policy generation trigger.
Also, in debug mode, the generation process does receive a notification of a need of a new generation as demonstrated by the line:
[2023-07-17 15:59:04+0200] DEBUG policy.generation.manager - Automatic policy generation request: queued - one policy generation already running
But unfortunately, after the one started before the edition, the queue does not continue and is stopped (the queued generations never happened).
To reproduce:
- On a 7.3.4+ webapp version with one node, named agent1
- Create a directive
- Prepare a new rule, which will be applied to "All managed nodes", and containing the newly created directive, but do not save it yet!
- trigger a generation
- quickly save the prepared directive
See how the policies for the agent1 are not changed, except in the rule webpage.
This may be very upsetting for users with very long generation time.
Files
[2023-07-17 15:59:04+0200] DEBUG policy.generation.manager - Manual policy generation request: start policy generation (none running)
[2023-07-17 15:59:04+0200] DEBUG policy.generation.manager - Policy generation starts now!
[2023-07-17 15:59:04+0200] INFO policy.generation - Start policy generation, checking updated rules
[2023-07-17 15:59:04+0200] DEBUG policy.generation - Policy generation parallelism set to: 1 (change with REST API settings parameter 'rudder_generation_max_parallelism')
[2023-07-17 15:59:04+0200] DEBUG policy.generation - Policy generation JS evaluation of directive parameter timeout: 30 seconds s (change with REST API settings parameter 'rudder_generation_jsTimeout')
[2023-07-17 15:59:04+0200] DEBUG policy.generation - Policy generation continues on NodeConfigurations evaluation: false (change with REST API settings parameter 'rudder_generation_continue_on_error')
[2023-07-17 15:59:04+0200] INFO policy.generation - [metrics] Xmx:1 GB nodes:2 (cached:0) rules:4 (enabled:3) techniques:8 (enabled:8) directives:8 (enabled:8) groups:2 (dynamic:2) parameters:2
[2023-07-17 15:59:04+0200] INFO policy.generation - Configuration of 2 nodes were updated, their policies are going to be written
[2023-07-17 15:59:04+0200] DEBUG policy.generation.update - -> updating nodes: [root, b6ed2a01-db88-40d8-ba12-8094f7899f4f]
[2023-07-17 15:59:04+0200] DEBUG policy.generation.manager - Automatic policy generation request: queued - one policy generation already running
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Can use atomic move from policy new folder to base folder
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Can use atomic move from policy base folder to archive folder
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive common-hasPolicyServer-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive rudder-service-apache-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive rudder-service-postgresql-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive rudder-service-relayd-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive rudder-service-slapd-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive rudder-service-webapp-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive server-common-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive inventory-all
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive common-hasPolicyServer-root
[2023-07-17 15:59:05+0200] DEBUG policy.generation - Could not find the bounded variable TRACKINGKEY for TRACKINGKEY in Directive inventory-all
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Timing summary:
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Run pre-gen scripts hooks : 1 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Run pre-gen modules hooks : 0 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Fetch all information : 25 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Build current rule values : 3 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Build target configuration : 19 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Write node configurations : 1636 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Save expected reports : 1 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Run post generation hooks : 167 ms
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Number of nodes updated : 2
[2023-07-17 15:59:06+0200] INFO policy.generation.timing - Policy generation succeeded in: 1 s
[2023-07-17 15:59:06+0200] INFO policy.generation.manager - Successful policy update '11' [started 2023-07-17 15:59:04 - ended 2023-07-17 15:59:06]
The dates are not the same than on the eventlog screen, but the process was almost the same as described in the initial ticket description.
- Status changed from New to Rejected
Sorry, I opened it also in #23074 - I'm closing this one, even if better redacted, since the PR is on the other one :/
- Is duplicate of Bug #23074: Generation not queued when one already started added
Also available in: Atom
PDF