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

update fatal exception handling #259

Merged
merged 1 commit into from
May 4, 2023

Conversation

sebastianburckhardt
Copy link
Member

The current implementation has many exception handlers that deliberately exclude fatal exceptions. While testing in the cloud, I noticed that this has some real disadvantages in some cases:

  • The out of memory exception is typically not getting logged anywhere, so we have no infomation on what happened. This is not a good idea because sometimes a single stack trace can reveal some bug or configuration error and help us diagnose and fix the problem. If we are not logging anything, we are much less likely to be able to address the underlying issues.

  • The out of memory exception is NOT guaranteed to instantly terminate the process. So, we still have to terminate as cleanly as we can, otherwise the application may continue to run partially, now in a bad state, and even do real damage (e.g. write incorrect things to storage).

This PR updates the handling of fatal exceptions to:

  • log information, then rethrow if appropriate
  • immediately fullly terminate the partition in cases where a fatal exception is thrown during event processing

Comment on lines +90 to +94
{
// for robustness, we swallow non-fatal exceptions inside event processing
// It does not mean they are not serious. We still report them as errors.
// (an incorrectly functioning partition is still better than a permanently dead one)
this.HandleError(nameof(ProcessEffectOn), $"Encountered exception on {trackedObject} when applying update event {this.currentUpdate} eventId={this.currentUpdate?.EventId}", exception, false, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to ask you about how this works at some point, but I realize this is consistent with current behavior so it's not a blocker

@sebastianburckhardt sebastianburckhardt merged commit 76ff28e into dev May 4, 2023
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.

2 participants