Skip to content

Removing the problematic MainThreadExceptionHandler #44

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

Conversation

diegoocampoh
Copy link

Setting defaultUncaughtExceptionHandler on static thread level is problematic:

  • Means that Statig is changing this setting for the host application, replacing the handler that such application had already defined.
  • Host application can anyways replace this after initialisation, meaning this handler will not be used.
  • This top level error handler re-throws the exception, which is explicitly advised no to do so on Java documentation:

Note that the default uncaught exception handler should not usually defer to the thread's ThreadGroup object, as that could cause infinite recursion.

This is causing unhandled exceptions to terminate threads and causing issues on host application on exceptions that are completely unrelated to Statsig.

See docs.

@diegoocampoh
Copy link
Author

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.

1 participant