commanded / eventstore

Event store using PostgreSQL for persistence
MIT License
1.06k stars 146 forks source link

Prevent double supervision by starting / stopping supervisor manually #194

Closed derekkraan closed 4 years ago

derekkraan commented 4 years ago

This fixes a bug where each Notification.Supervisor was being supervised by multiple EventStore.Supervisor (one local, the rest remote), which is an OTP no-no (causing EventStore.Supervisor to block on shutdown if it was not the parent of the global Notification.Supervisor.

I still think this solution is a bit janky, because we're essentially inventing our own supervisor here. Please take a look and let me know what you think.

derekkraan commented 4 years ago

Hi @slashdotdash, we have been testing this in production the last two days, it seems to be working just fine. I have been testing various scenarios of killing various parts of the system and seeing how it recovers, and so far seems to be working well.

slashdotdash commented 4 years ago

Thanks for the feedback @derekkraan. I will get this PR merged into master and the v1.0.0 release branch and publish a hotfix to Hex as v1.0.2.

derekkraan commented 4 years ago

@slashdotdash just a quick update, we have been running this in prod since I created this PR, haven't seen anything out of the ordinary.

slashdotdash commented 4 years ago

This has been published to Hex as v1.0.2.