Closed Bug 843029 Opened 11 years ago Closed 11 years ago

Add more retries to ensureDatabaseIsNotLocked

Categories

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

ARM
Android
defect
Not set
normal

Tracking

(firefox20+ fixed, firefox21+ fixed)

RESOLVED FIXED
Firefox 22
Tracking Status
firefox20 + fixed
firefox21 + fixed

People

(Reporter: mfinkle, Unassigned)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
If things go badly and the DB remains locked, the user is in trouble. Let's try a little harder to make sure the zombies have cleared up and any open DB connections have been closed.
Attachment #716016 - Flags: review?(lucasr.at.mozilla)
Attachment #716016 - Flags: review?(blassey.bugs)
Comment on attachment 716016 [details] [diff] [review]
patch

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

Looks good to me otherwise.

::: mobile/android/base/db/DBUtils.java
@@ +67,5 @@
> +        for (int retries = 0; retries < 5; retries++) {
> +            try {
> +                // Try a simple test and exit the loop
> +                dbHelper.getWritableDatabase();
> +                break;

I guess you meant 'return' here? Otherwise the log call you added below will always happen.
Attachment #716016 - Flags: review?(lucasr.at.mozilla) → review+
(In reply to Lucas Rocha (:lucasr) from comment #1)

> > +                dbHelper.getWritableDatabase();
> > +                break;
> 
> I guess you meant 'return' here? Otherwise the log call you added below will
> always happen.

Good catch. That's what I get for adding the Log and not looking at the rest of the patch. Fixed locally.
Comment on attachment 716016 [details] [diff] [review]
patch

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

as Lucas already pointed out the only issue I see. I also wonder what other useful information we can log on failure, but that can be a follow up.
Attachment #716016 - Flags: review?(blassey.bugs) → review+
Comment on attachment 716016 [details] [diff] [review]
patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: 
Testing completed (on m-c, etc.): 
Risk to taking this patch (and alternatives if risky): not a lot of risk. if this code is hit, we are in trouble already. the patch tries a little harder to bail us out.
String or UUID changes made by this patch: none
Attachment #716016 - Flags: approval-mozilla-beta?
Attachment #716016 - Flags: approval-mozilla-aurora?
Comment on attachment 716016 [details] [diff] [review]
patch

Due to time constraints on getting FF20b1 for mobile builds kicked off, approving for uplift though it will still need to land on trunk/aurora.
Attachment #716016 - Flags: approval-mozilla-beta?
Attachment #716016 - Flags: approval-mozilla-beta+
Attachment #716016 - Flags: approval-mozilla-aurora?
Attachment #716016 - Flags: approval-mozilla-aurora+
Blocks: 791958, 790922, 752828
OS: Linux → Android
Hardware: x86_64 → ARM
Version: Firefox 15 → Trunk
Blocks: 752828, 790922, 791958
OS: Linux → Android
Hardware: x86_64 → ARM
Target Milestone: --- → Firefox 22
Version: Firefox 15 → Trunk
https://hg.mozilla.org/mozilla-central/rev/b79b4213e3b2
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
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: