New issue
Advanced search Search tips

Issue 660563 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

IndexedDB: connections no longer reliably terminated on window close

Project Member Reported by jsb...@chromium.org, Oct 28 2016

Issue description

Take a peek at the history of this test:

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=storage%2Findexeddb%2Fpending-version-change-stuck.html

circa 10/19/2016 the test goes from flaky timeouts to timing out most of the time. Unfortunately, since the test has been flaky for a long time we didn't catch this. :(

The revision range around the change includes https://chromium.googlesource.com/chromium/src/+/627e7f73d47910f4255031de55075e2a04b222f6)

The test attempts to exercise this:

(1) In a window, open a connection w/ version = 1
(2) Have a worker try to open a connection w/ version = 2 - this will be blocked
(3) Navigate the page (it does this using a reload to `?second` just because that's how layout tests do things) which should close the window's connection and worker's attempt
(4) Try and open a connection w/ version = 1

The test never succeeds following the Mojo change; the reload is somehow failing to let the IndexedDBDatabase instance know that the initial window's (??) connection is gone. (I think I see the worker's connection closing??) That was previously done via the dispatcher host, so it's unsurprising that the Mojo change might have affected this.
 
Labels: M-56 OS-Android OS-Chrome OS-Linux OS-Mac OS-Windows
Status: Started (was: Assigned)
After investigating this for a while I've convinced myself that this is because there is a race between when a worker thread exits and when the UpgradeNeeded message is received. If the worker thread has already exited then this message is lost because there's no thread to deliver it to. This means that no WebIDBDatabaseImpl object is created for it and thus it isn't closed when the worker exits since it already did that.

The solution is to land my next Mojoification patch which, by passing a real Mojo pipe handle with the UpgradeNeeded command, properly ensures that if this handle gets discarded due to a dead thread then the pipe is closed, the IndexedDBConnection associated with it on the browser side is closed and thus the upgrade transaction is canceled.

After we land this patch we should monitor the tests to see if they stop being flaky.
Status: Fixed (was: Started)
After landing r430110 this test appears to now be passing consistently. If this continues over the weekend I'll get rid of the Timeout expectation.

Sign in to add a comment