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

Fix pending aggregates restarts: Supervisor restarts aggregate, that loses command routing and remains pending #22

Merged
merged 1 commit into from
Oct 31, 2016

Conversation

henry-hz
Copy link

When we start a new aggregate, and kill it, supervisor immediately restart it with the last state, replaying all the events. But when sending a new Command to the same aggregate UUID, a new aggregate is created, and updated, so we end up with two aggregates on memory, one unusable (and consumed resources to be restarted) and a new fresh one, that was started by the last command request. Using :observer.start can help to track their state and see what is going on. Pls, let me know if you need more details to reproduce it.

@henry-hz
Copy link
Author

Restart Strategies:
:permanent - the child process is always restarted
:temporary - the child process is never restarted (not even when the supervisor’s strategy is :rest_for_one or :one_for_all)
:transient - the child process is restarted only if it terminates abnormally, i.e., with an exit reason other than :normal, :shutdown or {:shutdown, term}

If we leave as transient, the process will be pending in case of any abnormal termination.

@slashdotdash
Copy link
Member

slashdotdash commented Oct 31, 2016

Thanks for the pull request & fix to this issue.

The same issue applies to the process manager supervisor as it is also using the :transient restart strategy. I'll apply the same change to this supervisor too.

@slashdotdash slashdotdash changed the title fix pending aggregates restarts - Supervisor restarts aggregate, that loses command routing and remains pending Fix pending aggregates restarts: Supervisor restarts aggregate, that loses command routing and remains pending Oct 31, 2016
@slashdotdash slashdotdash merged commit 6401775 into commanded:master Oct 31, 2016
slashdotdash added a commit that referenced this pull request Oct 31, 2016
Include description of fix for #22 in CHANGELOG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants