Skip to content
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

Capture "Startup Crashes" #12

Closed
4 of 5 tasks
bruno-garcia opened this issue May 17, 2022 · 3 comments
Closed
4 of 5 tasks

Capture "Startup Crashes" #12

bruno-garcia opened this issue May 17, 2022 · 3 comments

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented May 17, 2022

Problem

Most SDKs submit crash events in the background to not slow down the app start. When a crash happens immediately after SDK init it will never be sent to Sentry. Such a crash is called a start-up crash.

Solution

When the app crashes shortly (x seconds) after SDK is initialized, the SDK writes a marker file to the disk indicating the app crashes shortly after the SDK init.
The SDK init function doesn't return until the start-up crash is sent to Sentry or until a configurable timeout is reached.
If the timeout is reached the init function should return and the crash submission should continue in the background.

More details:

https://sentry.zendesk.com/agent/tickets/62388

@philipphofmann
Copy link
Member

philipphofmann commented Sep 12, 2022

Only flushing out the crash event makes things a bit complicated because:

  • we need to guarantee that the SDK sends the session init only once and only before other session updates
  • we can't use flush, which already exists in most SDKs. The SDK needs extra logic for this.

Most of the time, there shouldn't be too many envelopes queued for sending. Simply calling flush for all envelopes should be enough for 80% or more of the start-up crashes. I suggest we keep the logic simple and accept the tradeoff that maybe in some cases, the SDK will flush out other envelopes first before sending the start-up crash. We can iterate on this feature later.

Do you agree with this approach @bruno-garcia, @mattjohnsonpint, @marandaneto, @adinauer, @brustolin, @bitsandfoxes? If yes, comment with 👍. Otherwise, please add your concerns.

@philipphofmann philipphofmann moved this from Backlog to In Progress in Mobile & Cross Platform SDK Sep 27, 2022
@philipphofmann
Copy link
Member

We (@brustolin, @marandaneto, @romtsn, and @philipphofmann) decided to use 5 seconds for the blocking flushing call, and that crashes happening 2 seconds after the SDK init are start-up crashes.

@kahest
Copy link
Member

kahest commented Sep 27, 2023

Closing this mobile meta issue, Unity/.NET tracks remaining work separately

@kahest kahest closed this as completed Sep 27, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Done in Mobile & Cross Platform SDK Sep 27, 2023
@github-project-automation github-project-automation bot moved this from EA 🏁 to In Progress 📈 in Mobile Planning Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: In Progress 📈
Development

No branches or pull requests

5 participants