Closed Bug 595925 Opened 14 years ago Closed 14 years ago

Use OpenUnsharedDatabase in cookies (should fix intermittent test_cookies_read.js | command timed out: 300 seconds without output)

Categories

(Core :: Networking: Cookies, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- final+

People

(Reporter: dwitte, Assigned: dwitte)

References

()

Details

(Keywords: intermittent-failure, perf)

Attachments

(1 file)

OpenDatabase shares a cache, which apparently will cause contention between the sync read and the async read/write threads.

http://mxr.mozilla.org/mozilla-central/source/netwerk/cookie/nsCookieService.cpp#735

We should also update the interface doc (http://mxr.mozilla.org/mozilla-central/source/storage/public/mozIStorageService.idl#109) to state that using an unshared connection is a good idea when cache contention is expected.

(Side note: should we be using mozIStorageConnection::connectionReady before using the database?)
(In reply to comment #0)
> (Side note: should we be using mozIStorageConnection::connectionReady before
> using the database?)
No, the IDL appears to be wrong :(
Attached patch patchSplinter Review
Not sure if http://mxr.mozilla.org/mozilla-central/source/storage/public/mozIStorageService.idl#73 should also be removed (or rephrased, in both cases).
Assignee: nobody → dwitte
Status: NEW → ASSIGNED
Attachment #474751 - Flags: review?(sdwilsh)
Comment on attachment 474751 [details] [diff] [review]
patch

r+a=sdwilsh
Attachment #474751 - Flags: review?(sdwilsh)
Attachment #474751 - Flags: review+
Attachment #474751 - Flags: approval2.0+
Comment on attachment 474751 [details] [diff] [review]
patch

Actually, we need to get rid of exclusive locking too, which I thought we already did, but apparently did not do.  r=sdwilsh with that change.
Attachment #474751 - Flags: approval2.0+
This gives us a perf improvement from 16.6ms per async operation (!) to 284us per operation. Landing this will resolve the shutdown hangs some people have been seeing. We need this so bad.
Keywords: perf
blocking2.0: --- → final+
We need WAL for this, or we're going to run into sync connections failing to open because of writes occurring in the background. The alternative is to add sleep() calls to the sync connection code, which is really not cool.
Depends on: 598196
Blocks: 438871
Summary: Use OpenUnsharedDatabase in cookies → Use OpenUnsharedDatabase in cookies (should fix intermittent test_cookies_read.js | command timed out: 300 seconds without output)
Whiteboard: [orange]
Possible that this is causing cookie failure when restarting the browser and you find that your logged out of forums?
http://hg.mozilla.org/mozilla-central/rev/c477fdd59402
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: