[PlayerModel] [Fix] Retry starting new threads#2027
Merged
jkasten2 merged 1 commit intoplayer-model-mainfrom Mar 9, 2024
Merged
[PlayerModel] [Fix] Retry starting new threads#2027jkasten2 merged 1 commit intoplayer-model-mainfrom
jkasten2 merged 1 commit intoplayer-model-mainfrom
Conversation
Thread.start() can throw OutOfMemoryError errors and we can attempt to start the thread again. App developers can handle onTrimMemory and might be cleaning up memory. While the SDK can't know if this is being done its better to retry then to crash the app. This commit doesn't cover all new thread, just some of the most common ones. Also in v5 most new threads have been migrated to Kotlin coroutines so this patch should not be used outside of this player model branch.
Base automatically changed from
fix/player-model-null-taskQueueWaitingForInit.poll
to
player-model-main
March 9, 2024 01:10
emawby
approved these changes
Mar 9, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Handle
Thread.start()throwingOutOfMemoryErrorerrors by retrying.Details
Motivation
App developers can handle
onTrimMemoryand might be cleaning up memory. While the SDK can't know if this is being done it's better to retry then to crash the app.Scope
This commit doesn't cover all new threads, just some of the most common ones.
Also in v5 most new threads have been migrated to Kotlin coroutines so this PR should not be used outside of this player model branch.
Crash Examples
Crash 1
Crash 2
Crash 3
Crash 4
Testing
Manual testing
Ensured SDK run on an Android 14 emulator and network calls are being made.
Affected code checklist
Checklist
Overview
Testing
- Test are not passing on player-model-main
Final pass
This change is