Browser freezes due a lock contention across Places statements

RESOLVED FIXED in mozilla1.9.3a5

Status

()

Toolkit
Places
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Dolske, Assigned: mak)

Tracking

({dogfood})

unspecified
mozilla1.9.3a5
x86
Mac OS X
dogfood
Points:
---

Firefox Tracking Flags

(blocking2.0 final+)

Details

Attachments

(3 attachments)

(Reporter)

Description

7 years ago
Created attachment 438883 [details]
process sample output

I seem to be getting these freezes once or twice a day. Seems to happen most commonly shortly after starting the browser (or opening a bunch of tabs?), and maybe on shutdown. Samples have a similar pattern, usually docshell/history stuff is resetting a statement.

These freezes usually last 15-30 seconds, which is really bad. :(
(Reporter)

Comment 1

7 years ago
Created attachment 438948 [details]
Another hang

This was maybe 30 seconds after restarting the browser, just 2 tabs, both had restored. I was clicking the amusing "did you mean recursion" link when you Google recursion, and after 2 or 3 clicks it froze again. My places.sqlite file is 65006592 bytes in size.
(In reply to comment #1)
> This was maybe 30 seconds after restarting the browser, just 2 tabs, both had
> restored. I was clicking the amusing "did you mean recursion" link when you
> Google recursion, and after 2 or 3 clicks it froze again. My places.sqlite file
> is 65006592 bytes in size.
We should probably make this a pure async statement.  We have a lock contention issue there.
(Reporter)

Comment 3

7 years ago
Argh, these hangs are driving me crazy. :( sdwilsh, you said this was a simple fix, could you roll up a patch or reassign?
Assignee: nobody → sdwilsh
Keywords: dogfood
(Assignee)

Comment 4

7 years ago
i'm unsure is Shawn was pointing to registerOpenPage, but even if it's sync that is writing to a temp table, it should not cause any hang. Having a list of the statements that are running in that moment would be great.

i'd like to know what is this mozilla::storage::AsyncExecuteStatements::Run(). 

Make a backup of your places.sqlite so we don't lose the opportunity to reproduce this.

Let's start chcking expiration:
could you tell me the value of places.history.expiration.transient_current_max_pages

Then run in the error console
Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");PlacesDBUtils.checkAndFixDatabase();

and post the log that will come out after some seconds
The problem is the call to Reset on the main thread, which is called by ExecuteAsync (due to a scoper: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/src/History.cpp#80).  We really need to abandon the scoper if we've succeeded everything, so this turns into a two liner.
(Assignee)

Comment 6

7 years ago
yeah that scoper should not be there, good catch
(Assignee)

Comment 7

7 years ago
Stealing bug, Shawn will just review.
I'm actually touching the same code to remove Storage deprecate APIs usage, thus since that bug is in review i have to enqueue things to aviod bitrotting.
Assignee: sdwilsh → mak77
(Assignee)

Updated

7 years ago
Summary: Browser freezes due to Places statements → Browser freezes due a lock contentions across Places statements
(Assignee)

Comment 8

7 years ago
Created attachment 441772 [details] [diff] [review]
patch v1.0
Attachment #441772 - Flags: review?(sdwilsh)
(Assignee)

Updated

7 years ago
Summary: Browser freezes due a lock contentions across Places statements → Browser freezes due a lock contention across Places statements

Updated

7 years ago
Attachment #441772 - Flags: review?(sdwilsh) → review+
(Assignee)

Comment 9

7 years ago
http://hg.mozilla.org/mozilla-central/rev/5798a44e9184
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
(Reporter)

Updated

7 years ago
Blocks: 563538
blocking2.0: ? → final+
(Assignee)

Updated

7 years ago
Depends on: 546253
(Assignee)

Updated

7 years ago
No longer depends on: 546253
You need to log in before you can comment on or make changes to this bug.