Skip to content

A way to stop ANR manually #1150

Open
Open
@Galkon

Description

@Galkon

Problem Statement

Every now and then I see ANR issues related to objects being destroyed during app quit. I'm not sure what is expected behavior by Sentry SDK upon app quit, but given the varying ways people can prevent default behavior for before-quit, will-quit, window-all-closed, etc -- perhaps an explicit way to stop ANR before shut down would be ideal.

Solution Brainstorm

I tried this, based on the source code:
Sentry.getClient()?.getIntegrationByName('Anr')?.stopWorker()

But getClient() is undefined, for some reason? So I'm not sure if I can accomplish this at all currently. As well as stopWorker() is not exposed via types.

I would suggest something like Sentry.disableAnrIntegration() or something easy for users to call from main or renderer processes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions