-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Ensure exceptions during CatchUpHook are properly handled #4908
Comments
This can hopefully be simplified a lot with #4992 |
While working on the subscription engine #5321 we thought about multiple ways of reacting to errors. One implementation was that errors should rollback the projection and put it into error state and the hooks "around" the catchup will do a full rollback (the behaviour of
The idea was that for a failed catchup hook we will try to make it look like that the event was never processed. The other chained hooks would not get to react but that would be fine as after fixing the hook and running reactivateSubscription all hooks are run again. Also the position is rolled back in the database in the The exact behaviour can be read from this test https://github.com/neos/neos-development-collection/blob/caa70bf4a33486e28aa7e2e302a8799ce263f53c/Neos.ContentRepository.BehavioralTests/Tests/Functional/Subscription/CatchUpHookErrorTest.php But the behaviour to have the hooks like Ultimately we got to the agreement pretty fast that So implementing a sophisticated rollback mechanism here - which only works if the catchup uses the same dbal instance (and for that matter a database at all - emails might already be sent) - is overkill. We cant prevent the The solution is to collect the errors - ignore them for now - and return them via the Collecting errors also fixes two more things: That leaves us with the following error definition:
The exact behaviour can once again be read from this test: https://github.com/neos/neos-development-collection/blob/6b59fdbfe0d324b035935c1d2d051e223cd95ae3/Neos.ContentRepository.BehavioralTests/Tests/Functional/Subscription/CatchUpHookErrorTest.php Not stopping the full catchup - during a replay - and possibly collecting thousands of errors is the only downside. Further a new hook will be introduced which is explained as follows:
All other hooks can be described like
|
Currently any faulty catchup implementation can prevent a replay.
As they are rather optional, maybe the should not crash the whole system?
The text was updated successfully, but these errors were encountered: