Repository navigation
Add AttachAllThreadsToAppHangs to attach all threads to native app-hang events - #2963
Draft
bitsandfoxes wants to merge 3 commits into
Draft
bitsandfoxes wants to merge 3 commits into
bitsandfoxes wants to merge 3 commits into
Conversation
Contributor
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
With
EnableAppHangTrackingon, native app-hang events on Windows, Linux and macOS carry only the stack of the hung main thread. When the main thread is waiting on a job worker, the render thread or a lock, the event shows the wait but not its cause. sentry-native 0.17.7 can attach every thread's stack to app-hang events (getsentry/sentry-native#2327), but the SDK sets the native options itself and gives users no way to turn this on.How
Users opt in with
SentryUnityOptions.AttachAllThreadsToAppHangs, which is off by default. In the editor it's the Attach All Threads toggle under App Hang Tracking (Experimental) in the Advanced tab, saved in the options asset. When it's on together withEnableAppHangTracking, app-hang events also carry the names and stack traces of the other threads.When the option is on,
SentryNativeBridge.Initcallssentry_options_set_app_hang_thread_stackwalk_modewithSENTRY_THREAD_STACKWALK_MODE_ALL. With the default the setter is never called, so app-hang events stay as they are today.Caveats
sleeporpollearly withEINTR.Closes #2956