Bug 25788 - Reloading a page while a database transaction is in progress leaves the database locked.
: Reloading a page while a database transaction is in progress leaves the datab...
Status: RESOLVED DUPLICATE of bug 25711
: WebKit
WebCore Misc.
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
  Show dependency treegraph
Reported: 2009-05-14 04:57 PST by
Modified: 2009-05-19 14:26 PST (History)

Proposed fix. (11.13 KB, patch)
2009-05-14 09:27 PST, Ben Murdoch
no flags Review Patch | Details | Formatted Diff | Diff


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

Description From 2009-05-14 04:57:35 PST
If the user navigates away from a page whilst a database transaction is in progress, the database lock is never released and subsequent accesses to that database fail.

This is what I think is happening:
- The transaction starts.
- Whilst the transaction is still executing, the user reloads the page.
- In the document::stopAllDatabases method, the database is stopped and the database thread asked to die.
- The page reloads.
- The transaction eventually finishes executing and schedules it's next step in the database thread. However the database thread was asked to die, and so is about to complete, which means the next transaction step is never executed and so the transaction is never committed or rolled back. So, the lock on the database file is never released.

I have a patch to fix and a layout test to verify in the works, should be ready soon.
------- Comment #1 From 2009-05-14 09:27:11 PST -------
Created an attachment (id=30343) [details]
Proposed fix.

This patch fixes the bug by setting a busy handler for database transactions and running the error steps synchronously should the database the transaction was running on be stopped whilst it is running. The busy handler is needed to make transactions on the new page wait for the old transaction to complete and roll back before running.
------- Comment #2 From 2009-05-19 14:24:50 PST -------

*** This bug has been marked as a duplicate of 25711 ***