-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Prevent catchup hooks from halting the projections
updates bfb4655 to not do a full rollback if catchup hooks fail but continue and collect their errors, which will be rethrown later with the advantage that the catchup worked!
- Loading branch information
Showing
8 changed files
with
287 additions
and
159 deletions.
There are no files selected for viewing
250 changes: 158 additions & 92 deletions
250
....ContentRepository.BehavioralTests/Tests/Functional/Subscription/CatchUpHookErrorTest.php
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Neos.ContentRepository.Core/Classes/Projection/CatchUpHook/CatchUpHookFailed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\Core\Projection\CatchUpHook; | ||
|
||
/** | ||
* Thrown if a delegated catchup hook fails | ||
* | ||
* @implements \IteratorAggregate<\Throwable> | ||
* @api | ||
*/ | ||
final class CatchUpHookFailed extends \RuntimeException implements \IteratorAggregate | ||
{ | ||
/** | ||
* @internal | ||
* @param array<\Throwable> $additionalExceptions | ||
*/ | ||
public function __construct( | ||
string $message, | ||
int $code, | ||
\Throwable $exception, | ||
private readonly array $additionalExceptions | ||
) { | ||
parent::__construct($message, $code, $exception); | ||
} | ||
|
||
public function getIterator(): \Traversable | ||
{ | ||
$previous = $this->getPrevious(); | ||
if ($previous !== null) { | ||
yield $previous; | ||
} | ||
yield from $this->additionalExceptions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
Neos.ContentRepository.Core/Classes/Subscription/Exception/CatchUpFailed.php
This file was deleted.
Oops, something went wrong.