streak icon indicating copy to clipboard operation
streak copied to clipboard

Subscriptions could log errors to event store.

Open alanbem opened this issue 6 years ago • 0 comments

Subscription could catch exception that was thrown by underlying listener and $this->applyEvent(SubscriptionCaughtAnException($e->getMessage(), $version, $now)); and stop listening (until next run of its streak:subscription:run) and maybe even sleep for some number of seconds. It could be even configurable feature that can be turned on or off.

How about stopping subscription entirely after it caught an error and require manual intervention (maybe running streak:subscription:enable command?). Again it could be configurable feature that can be turned on or off, so catching an error would not necessary stop subscription. If subscription be configured to stop after error it could give support-team some time to investigate instead spamming event store with error event up until cause is fixed.

After fixing some massive outages there could be streak:subscriptions:enable (with required --force option because it would be easy to run streak:subscription:enable by mistake instead?) command that could find all subscriptions in error state and enable them back to work. ...or... It could internally use pausing/unpausing mechanism proposed in #90

Next thing would be creating infrastructure listener that would send emails in case of an subscription error.


Remember to not check if listener is completed in case of caught error.

alanbem avatar Dec 04 '19 23:12 alanbem