Skip to content
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

Bubble up exceptions happening when handling events #215

Merged
merged 6 commits into from
Feb 25, 2025

Conversation

Le-Merle
Copy link
Contributor

Description of changes

Using Task.WhenAll() will wait until every task is in a completed state before returning. This is problematic when a single subscription crashes, as we would normally expect the exception to bubble up to the IHost and crash it, thus enabling the entire app to be restarted, but it's not happening as long as at least one subscription hasn't crashed out.

This replaces Task.WhenAll() with a system that immediately bubbles up the first exception encountered.

Breaking changes

In theory, a pod that was running this background service would survive a crash in a subscription as long as any other subscription didn't crash. With this change, the pod is expected to crash entirely, enabling k8s to detect the broken state and restart it.

Additional checks

  • Added new tests that cover the code changes

@Le-Merle Le-Merle requested a review from a team as a code owner February 20, 2025 20:13
@Le-Merle Le-Merle merged commit 6689b77 into main Feb 25, 2025
5 checks passed
@Le-Merle Le-Merle deleted the feature/SGPD-1770_Bubble-Up-Errors-On-PullDelivery branch February 25, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants