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

Process Manager listening for unwanted Commands, and creating a junk snapshot. #25

Closed
henry-hz opened this issue Nov 2, 2016 · 7 comments
Labels

Comments

@henry-hz
Copy link

henry-hz commented Nov 2, 2016

When making a simple account creation and deposit, I observed that a snapshot was created even with no process manager command. Notice that the source_uuid [left postgre window] has used the "transfer_uuid" from the DepositMoney command.

bug-processmanager

@henry-hz
Copy link
Author

henry-hz commented Nov 2, 2016

I am thinking about implementing a FSM data structure, so this kind of problem couldn't happen.
https://github.com/sasa1977/fsm

Makes sense ? Should I proceed an PR ?

@slashdotdash
Copy link
Member

slashdotdash commented Nov 2, 2016

Yes, you've discovered an issue in that area. The Commanded.ProcessManagers.ProcessRouter.continue_process_manager function should ensure that when it starts the process manager it is starting a process that has already been created. The snapshot data for that process must be present.

Feel free to work on a pull request. I use Saša's fsm library in the eventstore. Otherwise I'll add this to the roadmap and get it fixed.

@henry-hz
Copy link
Author

henry-hz commented Nov 3, 2016

Please, add to the roadmap, I still have to study the code to know how to fix this bug

@slashdotdash
Copy link
Member

It's in the backlog of the Development roadmap.

@Trevoke
Copy link
Contributor

Trevoke commented Jan 30, 2018

Is this still known to be an issue?

@slashdotdash
Copy link
Member

slashdotdash commented Jan 30, 2018

@Trevoke Process managers are comprised of two components: a router and many instances. The router subscribes to the event store and routes events to instances, this might require starting a new process or resuming an existing one. A process manager instance handles the event, returning any relevant commands, then mutates its state. It records a snapshot of the mutated state after each event it processes.

I'm in the process of reworking process managers so that they use linked events as their persistence mechanism (event sourcing), with optional state snapshots so they resemble how aggregates persist their state. That change will resolve this issue.

@slashdotdash
Copy link
Member

slashdotdash commented Jul 25, 2018

Fixed by #181.

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

No branches or pull requests

3 participants