Skip to content
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

Making workflow engine truly stateless #225

Open
Charles546 opened this issue Apr 23, 2020 · 1 comment
Open

Making workflow engine truly stateless #225

Charles546 opened this issue Apr 23, 2020 · 1 comment

Comments

@Charles546
Copy link
Collaborator

The workflow engine currently has an in memory data structure that holds all in-fly workflow sessions. We can't safely restart the daemon when there are workflows running. We have an issue to have a way to gracefully restart the daemon #190, but for a busy daemon, it will be challenging to find a window to do upgrade/maintenance etc.

The proposed solution is to persist the data into some kind of database such as consul, redis, memcached, couchdb etc. This way, we can safely/gracefully shutdown the daemon for upgrade or maintenance.

@Charles546
Copy link
Collaborator Author

The issue #226 is the first step in resolving this issue. We still need to change the code in internal/workflow to use the cache, and the communication between the workflow engine and operator needs to be node neutral (currently, we use engine IP to identify the node of the engine like below.)

if msg.Subject == "command" {
sessionID, ok := msg.Labels["sessionID"]
if ok && sessionID != "" {
msg.Labels["engine"] = dipper.GetIP()
}
topic = eventbus.CommandTopic
} else if msg.Subject == "return" {
returnTo, ok := msg.Labels["engine"]
if !ok {
log.Panicf("[%s] return message without receipient", driver.Service)
}
topic = eventbus.ReturnTopic + returnTo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant