Skip to content

Add logging in Exceptions.throwIf[Jvm]Fatal, add isFatal methods#3122

Merged
simonbasle merged 7 commits into3.4.xfrom
3111-logInThrowIfFatal
Aug 1, 2022
Merged

Add logging in Exceptions.throwIf[Jvm]Fatal, add isFatal methods#3122
simonbasle merged 7 commits into3.4.xfrom
3111-logInThrowIfFatal

Conversation

@simonbasle
Copy link
Copy Markdown
Contributor

This commit improves the discoverability of exceptions that are "fatal"
to Reactor by:

  • adding Exceptions.isFatal and Exceptions.isJvmFatal methods
  • adding logging to Exceptions.throwIfFatal and
    Exceptions.throwIfJvmFatal just before a fatal exception is thrown

This should at least help pinpointing such occurrences from the logs,
in cases where the thrown exception bubble all the way up the stack of
a thread with no uncaughtExceptionHandler for example.

Fixes #3111.

@simonbasle simonbasle requested a review from a team as a code owner July 21, 2022 15:50
@simonbasle simonbasle added this to the 3.4.22 milestone Jul 21, 2022
@simonbasle simonbasle added the type/enhancement A general enhancement label Jul 21, 2022
@simonbasle simonbasle self-assigned this Jul 21, 2022
@simonbasle
Copy link
Copy Markdown
Contributor Author

cc @elefeint

@simonbasle
Copy link
Copy Markdown
Contributor Author

note: the tests that assert logs could benefit from test features added in #3123

@simonbasle simonbasle marked this pull request as draft July 22, 2022 15:45
This commit improves the discoverability of exceptions that are "fatal"
to Reactor by:
 - adding `Exceptions.isFatal` and `Exceptions.isJvmFatal` methods
 - adding logging to `Exceptions.throwIfFatal` and
 `Exceptions.throwIfJvmFatal` just before a fatal exception is thrown

This should at least help pinpointing such occurrences from the logs,
in cases where the thrown exception bubble all the way up the stack of
a thread with no uncaughtExceptionHandler for example.

Fixes #3111.
@simonbasle simonbasle force-pushed the 3111-logInThrowIfFatal branch from f8f2f34 to 7c93a85 Compare August 1, 2022 14:22
@simonbasle
Copy link
Copy Markdown
Contributor Author

rebased on top of 3.4.x since #3123 has now been merged. will also adapt the throwIfFatal test to make use of new JUnit5 extension

@simonbasle simonbasle marked this pull request as ready for review August 1, 2022 14:26
@simonbasle simonbasle merged commit 50bb983 into 3.4.x Aug 1, 2022
@reactorbot
Copy link
Copy Markdown

@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to main 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exceptions.throwIfFatal / throwIfJvmFatal should log fatal exceptions

4 participants