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
Workflow backends: ignore on hot reloading #7433
Workflow backends: ignore on hot reloading #7433
Conversation
func (wfbe *workflowBackend) Init(ctx context.Context, comp compapi.Component) error { | ||
wfbe.lock.Lock() | ||
defer wfbe.lock.Unlock() | ||
func (w *workflowBackend) Init(ctx context.Context, comp compapi.Component) error { |
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.
Please don't rename variables for no reason, it causes unnecessary merge conflicts
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.
By convention we use single letter variable names for method receiver variables. This gives overhead to the reader as it is unexpected. wfbe
initially tripped my up as I was confused as to where this variable was coming from until I realized it was the receiver.
wg.Wait() | ||
|
||
errs := make([]error, 0, len(group.resources)) | ||
for range group.resources { |
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.
for range group.resources { | |
for i := 0; i < len(group.resources); i++ { |
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.
What is the benefit of creating the variable i
here?
@@ -48,7 +49,7 @@ type ComponentStore struct { | |||
pubSubs map[string]PubsubItem | |||
topicRoutes map[string]TopicRoutes | |||
workflowComponents map[string]workflows.Workflow | |||
workflowBackends map[string]wfbe.WorkflowBackend | |||
workflowBackends map[string]backend.Backend |
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.
Why this 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.
This is the correct type for the workflow backend implementation interface. Notice the other component types are using the interface types defined in components-contrib
however backends is using durabletask-go
directly. This wasn't picked up before as this field wasn't previously being used (workflowbackend.go
didn't exist). wfbe.WorkflowBackend
is a factory func type.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #7433 +/- ##
==========================================
- Coverage 62.30% 62.29% -0.01%
==========================================
Files 244 244
Lines 22203 22210 +7
==========================================
+ Hits 13833 13836 +3
Misses 7232 7232
- Partials 1138 1142 +4 ☔ View full report in Codecov by Sentry. |
Updates the hot reloading reconciler so that Daprd will exit error when a actor state store enabled Component is hot reloaded. This is chosen because today, the actors subsystem is not written with any closing or dynamic support. Doing so will cause panics/corruption in its current state. Exiting error is the safest option as this ensures consistency across a replica set and ensures there is no surprise for the user that behaviour does not match given configuration. See also dapr#7433 Signed-off-by: joshvanl <me@joshvanl.dev>
Updates the hot reloading reconciler so that Daprd will exit error when a actor state store enabled Component is hot reloaded. This is chosen because today, the actors subsystem is not written with any closing or dynamic support. Doing so will cause panics/corruption in its current state. Exiting error is the safest option as this ensures consistency across a replica set and ensures there is no surprise for the user that behaviour does not match given configuration. See also dapr#7433 Signed-off-by: joshvanl <me@joshvanl.dev>
4450de0
to
e05b4b9
Compare
Updates the hot reloading reconciler so that Daprd will exit error when a workflowbackend Component is hot reloaded. This is chosen because today, the actors and workflow subsystems are not written with any closing or dynamic support. Doing so will cause panics/corruption in its current state. Exiting error is the safest option as this ensures consistency across a replica set and ensures there is no surprise for the user that behaviour does not match given configuration. Adds integration tests for daprd ensuring workflow backends can be loaded on boot. Adds tests to ensure daprd will exist error on a workflow backend being hot reloaded. We should do the same for actor state store and the actor subsystem. Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
registered Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
e05b4b9
to
ba58da7
Compare
reconciled Signed-off-by: joshvanl <me@joshvanl.dev>
* Exit error if actor state store hot reloaded Updates the hot reloading reconciler so that Daprd will exit error when a actor state store enabled Component is hot reloaded. This is chosen because today, the actors subsystem is not written with any closing or dynamic support. Doing so will cause panics/corruption in its current state. Exiting error is the safest option as this ensures consistency across a replica set and ensures there is no surprise for the user that behaviour does not match given configuration. See also #7433 Signed-off-by: joshvanl <me@joshvanl.dev> * Remove expected workflow.dapr component from actorastate tests Signed-off-by: joshvanl <me@joshvanl.dev> * Increase assert Eventually timeout Signed-off-by: joshvanl <me@joshvanl.dev> * Only log error and don't exit error when reocnciling actor state store Signed-off-by: joshvanl <me@joshvanl.dev> --------- Signed-off-by: joshvanl <me@joshvanl.dev> Signed-off-by: Artur Souza <asouza.pro@gmail.com> Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Updates the hot reloading reconciler so that Daprd will log and error and ignore workflow backends when they are hot reloaded.
Adds integration tests for daprd ensuring workflow backends can be loaded on boot.
Adds tests to ensure daprd will log an error on a workflow backend being hot reloaded.
Adds tests to ensure multiple workflow backends cannot be loaded at once.
closes #7409