Closed Bug 180306 Opened 22 years ago Closed 16 years ago

Global History doesn't give up trying to open its db if it fails and it doesn't work unless it can open its db

Categories

(Core Graveyard :: History: Global, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: timeless, Assigned: timeless)

Details

(Keywords: assertion)

I'm running with all sorts of interesting patches, i think the most interesting one leaves me without a profile directory which in turn should result in things that want a profile directory (like global history) being unable to create files. This isn't the normal way for things to fail, but I can describe some more typical cases where mozilla (or an embedder) might not be able to open/write to global history. Running mozilla from a CDRom or in a kiosk are two examples. It's also possible that someone might need to change the mount settings on their home drive to readonly for some period. If they do that, they might remount rw before quiting mozilla, in which case it'd be nice if we wrote the file out at the end of the session. WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file i:/build/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp, line 2368 WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(OpenDB())) failed, file i:/build/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp, line 612 WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(mGlobalHistory->AddPage(spec.get()))) failed, file i:/build/mozilla/docshell/base/nsDocShell.cpp, line 6410 I count 48 attempted opens just for my start page http://www.mozilla.org/start/ Afaik, there's one html page, one stylesheet, one icon, one banner, and the "download" image because i haven't set BUILD_OFFICIAL recently. -- ~10 opens per object seems extreme. Actually trying to go somewhere (home, probably the same page), i get more WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(OpenDB())) failed, file i:/build/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp, line 1182 WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(mGlobalHistory->IsVisited(resolvedPath.get(), &isVisited))) failed, file i:/build/mozilla/docshell/base/nsWebShell.cpp, line 776 And best of all, i don't get any history in the global history window. Issues: 1. history should work without a backing store. 2. history should probably give up trying to create a backing store and remember that it failed for the duration of a profile's session. 3. history can attempt to flush at session-logout.
While I think these are great ideas, I think the reality is that our current history implementation is not going to work without a backing store. (I suspect changes to Mork would be required for that..and I'd love to see that happen, but I think thats a much harder problem) What should be happening is that history should just quietly ignore failure if it failed to create a history DB the first time. The assertions are probably a little more aggressive than they need to be, I'm sure an NS_WARNING would suffice (my fault, perhaps overuse of NS_ENSURE_*)
Keywords: assertion
No one uses this code anymore, AFAIK (seamonkey and Firefox have moved to places).
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.