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

Sending from offline caching should be scheduled #803

Closed
bruno-garcia opened this issue Feb 5, 2021 · 3 comments
Closed

Sending from offline caching should be scheduled #803

bruno-garcia opened this issue Feb 5, 2021 · 3 comments
Assignees
Labels
Feature New feature or request

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented Feb 5, 2021

On startup we try to submit cached files. But that's done on the calling thread up to the specified timeout. The goal was to block the calling thread for up to a sensible default, in order to send 1 crash in case the app has a bug that causes it to crash right after starting.

But this blocking of Init to send the event doesn't mean that the calling thread should be use to send the event. In fact, during Init, sending cached events should be scheduled on a background thread, and if the timeout of waiting on Init elapses, Init should return but the background thread should continue to do its job and flush out queued events.

Even if InitCacheFlushTimeout is set to 0, the SDK should then simply schedule flushing these events to Sentry on Init, just not block at all on the Task. This way we don't need to rely on new events happening to capture cached events on app restart.

Docs will need to be updated: https://docs.sentry.io/platforms/dotnet/configuration/options/

i.e:

Setting this option to zero means that Sentry will not wait for events to be flushed before returning from Init, and if the app crashes again before the event is submitted on the background, it's possible events never make it into Sentry for an app that always crashes quickly after startup.

@bruno-garcia bruno-garcia added Feature New feature or request Sentry labels Feb 5, 2021
@bruno-garcia
Copy link
Member Author

bruno-garcia commented Jun 3, 2021

@SimonCropp
Copy link
Contributor

we think this is already done. @mattjohnsonpint will investigate

@mattjohnsonpint
Copy link
Contributor

Yes, this was fixed in #1644

Repository owner moved this from Needs Investigation to Done in Mobile & Cross Platform SDK Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
Archived in project
Development

No branches or pull requests

4 participants