-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow backends: ignore on hot reloading (#7433)
* Workflow backends: exit error on hot reload 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> * Review loop Signed-off-by: joshvanl <me@joshvanl.dev> * Update workflowbackend int tests for removed workflow comoponent registered Signed-off-by: joshvanl <me@joshvanl.dev> * Fix namespacing in workflowbackend integration test Signed-off-by: joshvanl <me@joshvanl.dev> * Changes hot reloading to only log an error when workflow backend is reconciled Signed-off-by: joshvanl <me@joshvanl.dev> * Fix bad merge conflict resolution. Signed-off-by: Artur Souza <asouza.pro@gmail.com> --------- Signed-off-by: joshvanl <me@joshvanl.dev> Signed-off-by: Artur Souza <asouza.pro@gmail.com> Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com> Co-authored-by: Artur Souza <asouza.pro@gmail.com>
- Loading branch information
1 parent
db1ece4
commit 2fe1316
Showing
21 changed files
with
1,362 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
Copyright 2024 The Dapr Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package compstore | ||
|
||
import ( | ||
"github.com/microsoft/durabletask-go/backend" | ||
) | ||
|
||
func (c *ComponentStore) AddWorkflowBackend(name string, backend backend.Backend) { | ||
c.lock.Lock() | ||
defer c.lock.Unlock() | ||
c.workflowBackends[name] = backend | ||
} | ||
|
||
func (c *ComponentStore) GetWorkflowBackend(name string) (backend.Backend, bool) { | ||
c.lock.RLock() | ||
defer c.lock.RUnlock() | ||
backend, ok := c.workflowBackends[name] | ||
return backend, ok | ||
} | ||
|
||
func (c *ComponentStore) ListWorkflowBackends() map[string]backend.Backend { | ||
c.lock.RLock() | ||
defer c.lock.RUnlock() | ||
return c.workflowBackends | ||
} | ||
|
||
func (c *ComponentStore) DeleteWorkflowBackend(name string) { | ||
c.lock.Lock() | ||
defer c.lock.Unlock() | ||
delete(c.workflowBackends, name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.