-
Notifications
You must be signed in to change notification settings - Fork 48
feat(server): opt-in uncaught exception capture #671
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d8bc581
feat(server): opt-in uncaught exception capture
cat-ph 06affef
fix(server): guard uncaught-handler lifecycle with setupLock
posthog[bot] d2ced6c
fix(server): flush the crash capture behind an executor barrier
cat-ph 59a37c1
fix(core): keep the ThreadDeath check compiling under newer JDKs
cat-ph 02b3de2
fix(core): always delegate even when the uncaught capture fails
cat-ph 737f697
refactor(server): route fatal exception events through a queue fatal β¦
cat-ph 277db0d
refactor(core): move the captured-throwables guard to the logback PR
cat-ph c50cd28
fix(core): use the canonical onuncaughtexception mechanism and name tβ¦
cat-ph e308994
fix(server): capture worker-thread uncaught exceptions as error, not β¦
cat-ph 3975eed
docs(server): document single-owner uncaught capture in the config KDoc
cat-ph 259e11e
fix(server): make the periodic flush timer a daemon thread
cat-ph 2174b3b
test(server): prove crash semantics on a real forked JVM
cat-ph c074bd9
fix(server): wait out a concurrent flush in the fatal drain
cat-ph 529b089
fix(server): send the fatal event in the first drained batch
cat-ph b7dc5a5
fix(server): keep the crash path bounded after the fatal drain
cat-ph 942bd71
fix(server): never evict a fatal event by capacity trimming
cat-ph 195b37c
fix(server): keep maxQueueSize a hard bound under fatal-only contents
cat-ph c2a2ac2
fix(server): refine fatal-priority eviction at the capacity bound
cat-ph dcbee3e
docs(server): note the fatal-trim victim choice is best-effort
cat-ph 7cd8bc0
Merge origin/main: reconcile the fatal crash path with the reworked fβ¦
cat-ph 8507cfb
style(server): drop redundant safe-calls flagged by CodeQL
cat-ph 0d4f164
fix(core): roll back a denied uncaught-handler installation
cat-ph a57eb1e
refactor(server): move the uncaught-capture wiring out of the client β¦
cat-ph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
| --- | ||
| 'posthog': patch | ||
| --- | ||
|
|
||
| Uncaught-exception events now use the canonical `onuncaughtexception` mechanism type. |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| 'posthog-server': minor | ||
| --- | ||
|
|
||
| Add `captureUncaughtExceptions`: opt in to capturing uncaught JVM exceptions as error tracking events, with a best-effort flush before the process exits. The SDK's flush timer is now a daemon thread and no longer keeps a finished JVM alive until `close()`. |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think this should live here, the integration should rather call flush directly instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair, updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm not yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π€ might have dropped the commit while playing with jj, sorry
updated! moved to PostHogUncaughtExceptionCapture, just calls install here
..but I left the flush no-op because I think capture() already uses the fatal path and the sync flush could block the crashing thread (well, no timeout as I see)