Last Comment Bug 559217 - Browser freezes due a lock contention across Places statements
: Browser freezes due a lock contention across Places statements
Status: RESOLVED FIXED
: dogfood
Product: Toolkit
Classification: Components
Component: Places (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla1.9.3a5
Assigned To: Marco Bonardo [::mak]
:
: Marco Bonardo [::mak]
Mentors:
Depends on:
Blocks: 563538
  Show dependency treegraph
 
Reported: 2010-04-13 16:23 PDT by Justin Dolske [:Dolske]
Modified: 2010-08-10 11:43 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
final+


Attachments
process sample output (28.30 KB, text/plain)
2010-04-13 16:23 PDT, Justin Dolske [:Dolske]
no flags Details
Another hang (33.91 KB, text/plain)
2010-04-13 23:03 PDT, Justin Dolske [:Dolske]
no flags Details
patch v1.0 (821 bytes, patch)
2010-04-27 04:49 PDT, Marco Bonardo [::mak]
sdwilsh: review+
Details | Diff | Splinter Review

Description Justin Dolske [:Dolske] 2010-04-13 16:23:12 PDT
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. :(
Comment 1 Justin Dolske [:Dolske] 2010-04-13 23:03:04 PDT
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.
Comment 2 Shawn Wilsher :sdwilsh 2010-04-15 09:39:34 PDT
(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.
Comment 3 Justin Dolske [:Dolske] 2010-04-23 17:53:56 PDT
Argh, these hangs are driving me crazy. :( sdwilsh, you said this was a simple fix, could you roll up a patch or reassign?
Comment 4 Marco Bonardo [::mak] 2010-04-24 01:52:25 PDT
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
Comment 5 Shawn Wilsher :sdwilsh 2010-04-24 12:47:19 PDT
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.
Comment 6 Marco Bonardo [::mak] 2010-04-25 01:25:09 PDT
yeah that scoper should not be there, good catch
Comment 7 Marco Bonardo [::mak] 2010-04-26 11:57:58 PDT
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.
Comment 8 Marco Bonardo [::mak] 2010-04-27 04:49:00 PDT
Created attachment 441772 [details] [diff] [review]
patch v1.0
Comment 9 Marco Bonardo [::mak] 2010-04-29 01:47:25 PDT
http://hg.mozilla.org/mozilla-central/rev/5798a44e9184

Note You need to log in before you can comment on or make changes to this bug.