-
Notifications
You must be signed in to change notification settings - Fork 26
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
Sporadic (but frequent) crash when uploading on Android 11 #251
Comments
Update: after vacuuming the DB (which took over half an hour) I am not seeing any more issues. So this could have to do with Android’s timing behavior, possibly with changes in Android 11 over 10 which would cause the method call for the update to return while some database work is still going on in the background (resulting in the DB being locked). The crash seems to happen at the end of the export, when the session is updated (marked a exported etc), in I would recommend updating the table on the @wish7code I know the project is on hiatus, but maybe you can provide some pointers as to what parts of the code I need to change. I see the DB update happens through one of two listeners; the other one seems to do some UI-related stuff and might need to run on the UI thread, hence we might need to move the DB update part away from the listeners and straight into the export task. |
A few sessions later, I am getting crashes again. Another DB reorganization (which again took at least half an hour) provided relief for the moment. (I should mention that I have some 250 sessions in my DB. Sizes vary from a few minutes’ duration, one cell and a few wifis to as much as 10 hours, 10K wifis and several hundred cells.) A botched DB (as in: any condition a reorg would fix) thus seems unlikely; however DB size may be a contributing factor. |
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Expected: session uploads and is marked as successfully exported.
Actual: Radiobeacon uploads all data but then crashes. This seems to be sporadic (more often than not) and it usually takes a few attempts for the export to complete successfully.
What version are you using? On what operating system?
93f6577 on Android 11 (LineageOS).
Please provide any additional information below.
This started after I updated from Android 10 to 11. The exception thrown is
android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5 SQLITE_BUSY)
; the sporadic nature indicates a possible race condition.Also, it seems that immediately after exporting one out of multiple sessions successfully, uploading another session will also succeed.
I fiddled around with this a bit on my own: I hunted down all calls to
getWritableDatabase()
; with one exception, all occur in the content provider. The one exception is the vacuum operation, though I do not believe that to be involved in this issue.I added
synchronized
to each and every content provider method which accesses the database and retried – same error. Maybe you can shed some light on this: which threads (also background tasks etc.) would access the database, and which of these could be running at the time a track is exported?The text was updated successfully, but these errors were encountered: