Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Issue 1419853003: [Media Router] Connection reattempt logic and bound pending request queue size. (Closed)

Created:
5 years, 2 months ago by imcheng
Modified:
5 years, 1 month ago
Reviewers:
mark a. foltz, Kevin M
CC:
chromium-reviews, feature-media-reviews_chromium.org, qsr+mojo_chromium.org, media-router+watch_chromium.org, viettrungluu+watch_chromium.org, posciak+watch_chromium.org, mcasas+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Media Router] Connection reattempt logic and bound pending request queue size. This patch address the following corner cases: 1. If OnConnectionError() is invoked while there are queued requests, this happens when extension is woken up but MRPM did not register with MR successfully. 2. Wake up extension failed. 3. After connection is established (RegisterMediaRouteProvider), we try to run all pending requests, but it's possible that the extension is already suspended at that point. It looks like an uncommon timing issue and does not appear to indicate a connection error. For 1 and 3, we will retry the wakeup (up to a max number of attempts) since there is no way to tell if the error was transient. For 2, it is usually due to a nonretriable error, so we will just drain the queue. The retry / drain logic also ensures pending requests do not sit in the queue indefinitely. Also, introduced a max limit queue size. When the queue size exceeds that limit, the oldest pending request will be dropped. A couple of things considered but not implemented: - Try to fail the pending request in some way instead of dropping them. First, not all types of requests can be failed, i.e. majority of them do not contain callbacks. Also because it is a corner case, the added complexity probably does not justify it. - Adding a permanent_failure bit to MediaRouterMojoImpl and automatically drop requests if set to true. Locking down the media router due to connection error feels too restrictive and I am not sure if it will help. BUG=490787 Committed: https://crrev.com/3dbd73f561741c78541d1a323706f337fc4717d5 Cr-Commit-Position: refs/heads/master@{#357047}

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : Addressed comments #

Patch Set 4 : rebase #

Patch Set 5 : #

Patch Set 6 : Fix tests and teardown order #

Total comments: 2

Patch Set 7 : addressed Kevin's comment #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -24 lines) Patch
M chrome/browser/media/router/media_router_mojo_impl.h View 1 2 3 6 chunks +42 lines, -2 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl.cc View 1 2 3 4 5 6 7 chunks +70 lines, -22 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl_unittest.cc View 1 2 3 4 5 2 chunks +89 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
imcheng
5 years, 2 months ago (2015-10-21 20:48:27 UTC) #2
imcheng
+Kevin since mark is OOO
5 years, 1 month ago (2015-10-27 23:18:42 UTC) #4
Kevin M
https://codereview.chromium.org/1419853003/diff/20001/chrome/browser/media/router/media_router_mojo_impl_unittest.cc File chrome/browser/media/router/media_router_mojo_impl_unittest.cc (right): https://codereview.chromium.org/1419853003/diff/20001/chrome/browser/media/router/media_router_mojo_impl_unittest.cc#newcode789 chrome/browser/media/router/media_router_mojo_impl_unittest.cc:789: EXPECT_CALL(*process_manager_, WakeEventPage(kExtensionId, _)) Set this outside the loop with ...
5 years, 1 month ago (2015-10-27 23:25:40 UTC) #5
imcheng
https://codereview.chromium.org/1419853003/diff/20001/chrome/browser/media/router/media_router_mojo_impl_unittest.cc File chrome/browser/media/router/media_router_mojo_impl_unittest.cc (right): https://codereview.chromium.org/1419853003/diff/20001/chrome/browser/media/router/media_router_mojo_impl_unittest.cc#newcode789 chrome/browser/media/router/media_router_mojo_impl_unittest.cc:789: EXPECT_CALL(*process_manager_, WakeEventPage(kExtensionId, _)) On 2015/10/27 23:25:40, Kevin M wrote: ...
5 years, 1 month ago (2015-10-27 23:32:01 UTC) #6
imcheng
The tests were fixed. Also fixed a teardown issue (MRMojoImpl has to be destroyed before ...
5 years, 1 month ago (2015-10-28 00:32:46 UTC) #7
Kevin M
lgtm https://codereview.chromium.org/1419853003/diff/100001/chrome/browser/media/router/media_router_mojo_impl.cc File chrome/browser/media/router/media_router_mojo_impl.cc (right): https://codereview.chromium.org/1419853003/diff/100001/chrome/browser/media/router/media_router_mojo_impl.cc#newcode732 chrome/browser/media/router/media_router_mojo_impl.cc:732: if (wakeup_attempt_count_ >= kMaxWakeupAttemptCount) { GE comparison for ...
5 years, 1 month ago (2015-10-30 00:37:42 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1419853003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1419853003/140001
5 years, 1 month ago (2015-10-30 04:39:25 UTC) #11
imcheng
https://codereview.chromium.org/1419853003/diff/100001/chrome/browser/media/router/media_router_mojo_impl.cc File chrome/browser/media/router/media_router_mojo_impl.cc (right): https://codereview.chromium.org/1419853003/diff/100001/chrome/browser/media/router/media_router_mojo_impl.cc#newcode732 chrome/browser/media/router/media_router_mojo_impl.cc:732: if (wakeup_attempt_count_ >= kMaxWakeupAttemptCount) { On 2015/10/30 00:37:42, Kevin ...
5 years, 1 month ago (2015-10-30 04:39:35 UTC) #12
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 1 month ago (2015-10-30 04:43:24 UTC) #13
commit-bot: I haz the power
5 years, 1 month ago (2015-10-30 04:44:09 UTC) #14
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/3dbd73f561741c78541d1a323706f337fc4717d5
Cr-Commit-Position: refs/heads/master@{#357047}

Powered by Google App Engine
This is Rietveld 408576698