-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #20462: Delay policy generation until rudder app is fully boot #4066
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to rebase the test, and correct a comment
The rest is 💯
...rces/rudder/rudder-core/src/main/scala/com/normation/rudder/batch/AsyncDeploymentActor.scala
Outdated
Show resolved
Hide resolved
@@ -554,6 +554,10 @@ class Boot extends Loggable { | |||
ApplicationLogger.error(s"Error when trying to save the EventLog for application start: ${err.fullMsg}") | |||
case Right(_) => ApplicationLogger.info("Application Rudder started") | |||
} | |||
|
|||
// release guard for promise generation awaiting end of boot | |||
RudderConfig.policyGenerationBootGuard.succeed(()).runNow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would never have thought to put it there, i was more thinking to put it at the end of bootcheck. It is without doubt better the way you did
PR rebased |
5d631d3
to
a339863
Compare
@@ -190,6 +190,7 @@ final case class FullNodeGroupCategory( | |||
case FullOtherTarget(t) => t match { | |||
case AllTarget => true | |||
case AllTargetExceptPolicyServers => !node.isPolicyServer | |||
case AllPolicyServers => node.isPolicyServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file should not change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it removes a warning missing pattern match (and the corresponding runtime exception) for a previous pr regarding migration.
I'm adding a comment in head.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
OK, merging this PR |
https://issues.rudder.io/issues/20462
That PR add a promise (ie something that can be done exactly once, and that other things can wait for it to be done) that is checked for completion before actually starting policy generation.
The promise is completed at end of
Boot.boot
method, ie once lift knows rudder is started.To be able to use the
promise.await
in policy generation agent, I needed to transform the code into a ZIO effect.Also remove a warning for missing pattern match which would lead to a runtime exception, likely introduced in pr #4065