Closed Bug 843005 Opened 11 years ago Closed 11 years ago

Disable Android SQLite locking in databases for REL 11 and higher

Categories

(Firefox for Android Graveyard :: Data Providers, defect)

15 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(firefox21+ fixed, firefox22+ fixed, firefox23 fixed)

RESOLVED FIXED
Firefox 23
Tracking Status
firefox21 + fixed
firefox22 + fixed
firefox23 --- fixed

People

(Reporter: mfinkle, Assigned: mfinkle)

Details

Attachments

(1 file, 1 obsolete file)

Android SQLiteDatabase has it's own built-in locking mechanism, separate from SQLite's own mechanism. It can be controlled with SQLiteDatabase.setLockingEnabled(boolean):
http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#setLockingEnabled(boolean)

As of SDK16, this is a no-op.

Even before it became a no-op the WebViewDatabase turned it off:
http://androidxref.com/4.0.4/xref/frameworks/base/core/java/android/webkit/WebViewDatabase.java#254

There are other resources that talk about turning off the Android locking becuase it is expensive:
http://www.enterra-inc.com/techzone/handling_sql_issues/

Even the Android source code says it's expensive.

Since we should be accessing the DB from the same GeckoBackgroundThread everywhere, I think it might be worth trying to disable locking.
Attached patch patch (obsolete) — Splinter Review
I want to run with this patch a bit and make some Try builds to see if anything shakes loose.
Assignee: nobody → mark.finkle
This patch limits the change to 11 or higher, since we are using write-ahead logging.
Attachment #716017 - Attachment is obsolete: true
https://tbpl.mozilla.org/?tree=Try&rev=b1e04efe8f0c (only the Android 4.0 run is of any concern)
Comment on attachment 733868 [details] [diff] [review]
patch 2: only REL 11 or higher

Try is really green, even after retriggering the tests. Let's try this on nightly where the DB locking crash is #3 and see if we can affect it.
Attachment #733868 - Flags: review?(bugmail.mozilla)
Comment on attachment 733868 [details] [diff] [review]
patch 2: only REL 11 or higher

Review of attachment 733868 [details] [diff] [review]:
-----------------------------------------------------------------

Assuming the panda rc2 comes out green at https://tbpl.mozilla.org/?tree=Try&rev=b1e04efe8f0c then r=me
Attachment #733868 - Flags: review?(bugmail.mozilla) → review+
Kats reminded me that rc2 has trouble on Android 4.0 and that I could land without waiting.
Summary: Disable Android SQLite locking in databases → Disable Android SQLite locking in databases for REL 11 and higher
https://hg.mozilla.org/mozilla-central/rev/07d20c5e4872
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Comment on attachment 733868 [details] [diff] [review]
patch 2: only REL 11 or higher

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: It's possible this could fix some DB locking failures we see on Android 15 (ICS). Android 16 and higher already no-op the SQL locking. This just does the same for 11 and higher.
Testing completed (on m-c, etc.): on m-c
Risk to taking this patch (and alternatives if risky): Based on what we know, this should be low risk, but I honestly don't know. So far so good on m-c.
String or IDL/UUID changes made by this patch: none

I want to see if this has any affect on the beta crash stats. Landing early allows us to test and backout if it causes unexpected problems.
Attachment #733868 - Flags: approval-mozilla-beta?
Attachment #733868 - Flags: approval-mozilla-aurora?
This may help mobile stability where we are having a number of DB related top-crashers in the past few cycles.We are still early in the beta cycle and the risk should be manageable .We still have a couple of opportunities to identify/fix issues or perform backout if needed .

Please land this asap so that this can make it in Beta 2 going to build today.
Attachment #733868 - Flags: approval-mozilla-beta?
Attachment #733868 - Flags: approval-mozilla-beta+
Attachment #733868 - Flags: approval-mozilla-aurora?
Attachment #733868 - Flags: approval-mozilla-aurora+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: