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

Move rcbridge initialization to RcloneProvider #23

Merged
merged 1 commit into from
Jul 1, 2023
Merged

Conversation

chenxiaolong
Copy link
Owner

RSAF was previously initializing rcbridge in MainApplication.onCreate(). Since all ContentProviders are initialized before the Application, it's possible to start receiving ContentProvider requests before rcbridge is initialized. This seems to trigger a deadlock in rclone and causes Android to kill RSAF due to the main thread hanging. When hitting this issue, crash.log would not be written because the killing is done via SIGQUIT, not via a JVM exception. This commit fixes the issue by initializing rcbridge in RcloneProvider.onCreate().

Fixes: #22

RSAF was previously initializing rcbridge in MainApplication.onCreate().
Since all ContentProviders are initialized before the Application, it's
possible to start receiving ContentProvider requests before rcbridge is
initialized. This seems to trigger a deadlock in rclone and causes
Android to kill RSAF due to the main thread hanging. When hitting this
issue, crash.log would not be written because the killing is done via
SIGQUIT, not via a JVM exception. This commit fixes the issue by
initializing rcbridge in RcloneProvider.onCreate().

Fixes: #22

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong self-assigned this Jul 1, 2023
@chenxiaolong chenxiaolong merged commit 8707453 into master Jul 1, 2023
@chenxiaolong chenxiaolong deleted the init_race branch July 1, 2023 22:07
chenxiaolong added a commit that referenced this pull request Jul 1, 2023
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
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.

RSAF has more bugs
1 participant