looplab / eventhorizon

Event Sourcing for Go!
Apache License 2.0
1.59k stars 195 forks source link

DB Mutex of Memory outbox blocks Saga #391

Open janiskemper opened 2 years ago

janiskemper commented 2 years ago

Describe the bug I use the memory outbox and wrote a saga that is an EventHandler called by the outbox. At the end of the saga, there is a new event created in the event store. This leads to the following situation:

To Reproduce

  1. Use the memory outbox
  2. Build a saga that calls some command which in turn leads to an event saved in the store
  3. Call a command X that leads to the creation of event A. The saga should handle event A and call a command Y that leads to the creation of event B.

Expected behavior The outbox should not block itself. I guess, that the db mutex could be safely removed from the memory outbox without anything serious happening.

Desktop (please complete the following information):

maxekman commented 2 years ago

Thanks for reporting! If you can provide a PR with a fix I would be happy to merge it.