Commit d71e9bcb authored by jsbell's avatar jsbell Committed by Commit bot

IndexedDB: Cancel transaction inactivity timer on Commit() arrival

After processing a batch of requests, our IDB transaction initiates an
inactivity timer; if the timer fires before any further requests
arrive from the front-end we assume the front-end is wedged and abort
the transaction. The timer is be stopped on any new request, including
a signal to commit or abort. During the introduction of blobs, the
"stop timer on commit signal" ended towards the end of the commit
flow, but it should be towards the start so it doesn't fire if the
back-end is busy.

Speculative fix for frequent timeouts of W3C web-platform-tests seen
on slow bots.

R=cmumford@chromium.org

Review URL: https://codereview.chromium.org/502643003

Cr-Commit-Position: refs/heads/master@{#292035}
parent 94a4210d
......@@ -238,6 +238,8 @@ void IndexedDBTransaction::BlobWriteComplete(bool success) {
leveldb::Status IndexedDBTransaction::Commit() {
IDB_TRACE1("IndexedDBTransaction::Commit", "txn.id", id());
timeout_timer_.Stop();
// In multiprocess ports, front-end may have requested a commit but
// an abort has already been initiated asynchronously by the
// back-end.
......@@ -285,8 +287,6 @@ leveldb::Status IndexedDBTransaction::CommitPhaseTwo() {
// alive while executing this method.
scoped_refptr<IndexedDBTransaction> protect(this);
timeout_timer_.Stop();
state_ = FINISHED;
leveldb::Status s;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment