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

Rework the background task service shutdown procedure to give more headroom against the 5s ANR timeout #1624

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

kstenerud
Copy link
Contributor

@kstenerud kstenerud commented Mar 14, 2022

Goal

In a worst case scenario, BackgroundTaskService.shutdown() could wait for 4.5 seconds to complete a shutdown, which is dangerously close to the 5s limit for an ANR if this happens on the main thread.

Rework so that all the shutdowns happen at the same time.

Testing

Rerun all tests. Unfortunately this manifest as a flake in CI so there's no definitive test for it.

@kstenerud kstenerud force-pushed the PLAT-7995-bgtask-shutdown-await branch 2 times, most recently from c1601f5 to 1caaa32 Compare March 15, 2022 09:39
@bugsnagbot
Copy link
Collaborator

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1437.99 1191.16
arm64_v8a 549.26 303.5
armeabi_v7a 520.59 278.93
x86 590.2 344.44
x86_64 573.83 328.07

Generated by 🚫 Danger

Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Pending a comment and a CHANGELOG entry

@kstenerud kstenerud force-pushed the PLAT-7995-bgtask-shutdown-await branch 2 times, most recently from e17d3da to 8958779 Compare March 15, 2022 12:50
@kstenerud kstenerud force-pushed the PLAT-7995-bgtask-shutdown-await branch from 8958779 to cdbc9f6 Compare March 15, 2022 12:52
@kstenerud kstenerud requested a review from lemnik March 15, 2022 12:59
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kstenerud kstenerud merged commit b786acf into next Mar 16, 2022
@kstenerud kstenerud deleted the PLAT-7995-bgtask-shutdown-await branch March 16, 2022 11:03
This was referenced Mar 17, 2022
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