Skip to content

Add out-of-process hang tracking with Native backend on Windows, Linux, and Mac#1427

Draft
tustanivsky wants to merge 10 commits into
mainfrom
feat/native-app-hang-tracking
Draft

Add out-of-process hang tracking with Native backend on Windows, Linux, and Mac#1427
tustanivsky wants to merge 10 commits into
mainfrom
feat/native-app-hang-tracking

Conversation

@tustanivsky

@tustanivsky tustanivsky commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

This PR adds support for sentry-native's out-of-process app-hang detection and wires it into the plugin's existing hang-tracking configuration, so that the Native backend gets daemon-side hang reporting instead of the engine-side watcher.

Key changes

  • When the native backend is selected (UseNativeBackend) on a supported platform, EnableHangTracking now drives sentry-native's app-hang detector instead of the engine FThreadHeartBeat watcher:
    • sentry_options_set_app_hang_enabled and sentry_options_set_app_hang_timeout_ms are configured before sentry_init (using the existing HangTimeoutDuration value as the timeout).
    • A lightweight per-frame heartbeat is registered on FCoreDelegates::OnEndFrame. Because OnEndFrame is broadcast on the game thread, the first tick latches it as the monitored thread (sentry_app_hang_set_target_thread), and each subsequent frame refreshes the heartbeat (sentry_app_hang_heartbeat). The out-of-process crash daemon monitors heartbeat staleness and emits an ApplicationNotResponding event while the game continues running.
  • The engine watcher (FSentryHangWatcher) is automatically disabled when the native detector is active to avoid double-reporting. It remains the fallback path for the Crashpad backend and on platforms where native app-hang detection is not supported.

Known limitations

  • Supported on desktop platforms with the native backend.
  • On macOS, hang tracking doesn't work in sandboxed game builds.

Relate items

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 5587527

@bitsandfoxes bitsandfoxes changed the title Add out-of-process hang tracking with Native backend on Windows and Mac Add out-of-process hang tracking with Native backend on Windows, Linux, and Mac Jun 10, 2026
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.

3 participants