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

Issue 2757373002: Fixing flakiness of TextureLayerChangeInvisibleMailboxTest (Closed)

Created:
3 years, 9 months ago by Saman Sami
Modified:
3 years, 8 months ago
Reviewers:
danakj
CC:
chromium-reviews, cc-bugs_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixing flakiness of TextureLayerChangeInvisibleMailboxTest The flake seems to be because of a race between the order of running main and impl thread. Resources are always reclaimed after impl threads posts DidCommitAndDrawFrame to the main thread so whether commit_count_ == 4 or 5 depends on whether we switch to main thread or keep running impl thread and reclaim resources which triggers posting a task to the main thread to release the mailbox. Even though the task for DidCommitAndDrawFrame is posted first, the task for releasing mailbox is posted using a blocking task runner so it is run first. In order to solve this issue, we decided to use DidReceiveCompositorFrameAck instead of DidCommitAndDrawFrame because all the resources are released before DidReceiveCompositorFrameAck is called so the race between releasing resources and starting next commit doesn't happen. In single-thread mode we used to call DidReceiveCompositorFrameAck directly instead of PostTasking which caused different behaviour from multi-thread mode. We decided to also use PostTask for DidReceiveCompositorFrameAck in single thread mode and use weak pointers to discard the ack if CompositorFrameSink is released before ack is processed. CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel BUG=702868 Review-Url: https://codereview.chromium.org/2757373002 Cr-Commit-Position: refs/heads/master@{#465638} Committed: https://chromium.googlesource.com/chromium/src/+/44b6dfc95bd4a7b8240b81720b9804692b439ae9

Patch Set 1 #

Patch Set 2 : Use DidReceiveCompositorFrameAck #

Patch Set 3 : Post DidReceiveCompositorFrameAck #

Patch Set 4 : Added comments #

Patch Set 5 : c #

Total comments: 4

Patch Set 6 : c #

Total comments: 3

Patch Set 7 : Don't PostTask release callback in single thread mode #

Total comments: 2

Patch Set 8 : c #

Patch Set 9 : Drop ack if CFS is gone #

Total comments: 2

Patch Set 10 : WeakPtr #

Patch Set 11 : WeakPtr for multi thread #

Patch Set 12 : Invalidate on DidLose #

Total comments: 1

Patch Set 13 : c #

Patch Set 14 : c #

Patch Set 15 : c #

Patch Set 16 : Added test #

Patch Set 17 : Cleanup #

Patch Set 18 : Rename #

Total comments: 12

Patch Set 19 : Addressed comments #

Total comments: 1

Patch Set 20 : Updated test #

Total comments: 4

Patch Set 21 : Rebased #

Patch Set 22 : Addressed comments #

Patch Set 23 : c #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -20 lines) Patch
M cc/layers/texture_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +4 lines, -13 lines 0 comments Download
M cc/test/layer_tree_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +6 lines, -0 lines 0 comments Download
M cc/test/test_hooks.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +4 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +81 lines, -0 lines 0 comments Download
M cc/trees/proxy_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +6 lines, -1 line 0 comments Download
M cc/trees/proxy_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -2 lines 0 comments Download
M cc/trees/proxy_main.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +4 lines, -0 lines 0 comments Download
M cc/trees/proxy_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +6 lines, -3 lines 0 comments Download
M cc/trees/single_thread_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -0 lines 0 comments Download
M cc/trees/single_thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +13 lines, -1 line 0 comments Download

Messages

Total messages: 122 (81 generated)
Saman Sami
PTAL
3 years, 9 months ago (2017-03-20 18:16:35 UTC) #9
danakj
The CL title "Fixing flakiness of TextureLayerChangeInvisibleMailboxTest" should be the first line of the Description. ...
3 years, 9 months ago (2017-03-20 19:01:48 UTC) #12
danakj
I don't understand what the race is from the description, can you explain why this ...
3 years, 9 months ago (2017-03-20 19:02:54 UTC) #13
Saman Sami
On 2017/03/20 19:02:54, danakj wrote: > I don't understand what the race is from the ...
3 years, 9 months ago (2017-03-20 19:14:57 UTC) #15
danakj
On 2017/03/20 19:14:57, Saman Sami wrote: > On 2017/03/20 19:02:54, danakj wrote: > > I ...
3 years, 9 months ago (2017-03-20 19:24:49 UTC) #16
danakj
On 2017/03/20 19:24:49, danakj wrote: > On 2017/03/20 19:14:57, Saman Sami wrote: > > On ...
3 years, 9 months ago (2017-03-21 16:24:00 UTC) #17
Saman Sami
On 2017/03/21 16:24:00, danakj wrote: > On 2017/03/20 19:24:49, danakj wrote: > > On 2017/03/20 ...
3 years, 9 months ago (2017-03-21 17:46:46 UTC) #18
danakj
On Tue, Mar 21, 2017 at 1:46 PM, <samans@chromium.org> wrote: > On 2017/03/21 16:24:00, danakj ...
3 years, 9 months ago (2017-03-21 18:41:51 UTC) #19
Saman Sami
On 2017/03/21 18:41:51, danakj wrote: > On Tue, Mar 21, 2017 at 1:46 PM, <mailto:samans@chromium.org> ...
3 years, 8 months ago (2017-03-29 15:58:07 UTC) #20
danakj
On 2017/03/29 15:58:07, Saman Sami wrote: > On 2017/03/21 18:41:51, danakj wrote: > > On ...
3 years, 8 months ago (2017-03-29 18:35:55 UTC) #21
Saman Sami
I was actually not aware of how BlockingTaskRunner works and I assumed it always runs ...
3 years, 8 months ago (2017-03-29 23:02:05 UTC) #22
danakj
On 2017/03/29 23:02:05, Saman Sami wrote: > I was actually not aware of how BlockingTaskRunner ...
3 years, 8 months ago (2017-03-31 18:30:23 UTC) #25
Saman Sami
The resources are returned separately from the ack but always before the ack to ensure ...
3 years, 8 months ago (2017-04-03 18:52:28 UTC) #26
Saman Sami
I tried using DidReceiveCompositorFrameAck in the unit test, hoping that it would fix the flakiness. ...
3 years, 8 months ago (2017-04-03 23:27:47 UTC) #27
Saman Sami
I'm not sure if single-thread mode is used in real world, but if it's used, ...
3 years, 8 months ago (2017-04-03 23:46:50 UTC) #28
danakj
On 2017/04/03 23:46:50, Saman Sami wrote: > I'm not sure if single-thread mode is used ...
3 years, 8 months ago (2017-04-04 18:22:25 UTC) #29
Saman Sami
Thanks! I did what you suggested. PTAL. I ran the test 20000 time and it ...
3 years, 8 months ago (2017-04-04 19:16:47 UTC) #36
danakj
Thanks! Now that we've identified DidCommitAndDrawFrame and DidReceiveCompositorFrameAck as being redundant would you be down ...
3 years, 8 months ago (2017-04-04 19:20:54 UTC) #37
Saman Sami
If it always make sense to use DidReceiveCompositorFrameAck instead, then yeah definitely. I actually think ...
3 years, 8 months ago (2017-04-04 19:32:13 UTC) #38
Saman Sami
https://codereview.chromium.org/2757373002/diff/80001/cc/trees/single_thread_proxy.cc File cc/trees/single_thread_proxy.cc (right): https://codereview.chromium.org/2757373002/diff/80001/cc/trees/single_thread_proxy.cc#newcode803 cc/trees/single_thread_proxy.cc:803: if (layer_tree_host_) On 2017/04/04 19:20:54, danakj wrote: > This ...
3 years, 8 months ago (2017-04-04 19:32:31 UTC) #39
danakj
On 2017/04/04 19:32:13, Saman Sami wrote: > If it always make sense to use DidReceiveCompositorFrameAck ...
3 years, 8 months ago (2017-04-04 19:36:21 UTC) #40
Saman Sami
I'll definitely look into using DidReceiveCompositorFrameAck in more places after this CL. Right now this ...
3 years, 8 months ago (2017-04-04 21:39:14 UTC) #45
danakj
https://codereview.chromium.org/2757373002/diff/100001/cc/trees/single_thread_proxy.cc File cc/trees/single_thread_proxy.cc (right): https://codereview.chromium.org/2757373002/diff/100001/cc/trees/single_thread_proxy.cc#newcode433 cc/trees/single_thread_proxy.cc:433: weak_factory_.GetWeakPtr())); You can make a separate weak factory for ...
3 years, 8 months ago (2017-04-04 21:47:50 UTC) #46
Saman Sami
I think my latest patch should make android happy. So basically we just call the ...
3 years, 8 months ago (2017-04-04 21:54:17 UTC) #49
danakj
https://codereview.chromium.org/2757373002/diff/120001/cc/layers/texture_layer.cc File cc/layers/texture_layer.cc (right): https://codereview.chromium.org/2757373002/diff/120001/cc/layers/texture_layer.cc#newcode302 cc/layers/texture_layer.cc:302: if (main_thread_task_runner->BelongsToCurrentThread()) { You're right this orders it right, ...
3 years, 8 months ago (2017-04-04 21:59:38 UTC) #50
Saman Sami
https://codereview.chromium.org/2757373002/diff/120001/cc/layers/texture_layer.cc File cc/layers/texture_layer.cc (right): https://codereview.chromium.org/2757373002/diff/120001/cc/layers/texture_layer.cc#newcode302 cc/layers/texture_layer.cc:302: if (main_thread_task_runner->BelongsToCurrentThread()) { I see. Yes, dropping the ack ...
3 years, 8 months ago (2017-04-04 22:12:44 UTC) #55
danakj
https://codereview.chromium.org/2757373002/diff/160001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/2757373002/diff/160001/content/browser/renderer_host/compositor_impl_android.cc#newcode809 content/browser/renderer_host/compositor_impl_android.cc:809: if (!has_compositor_frame_sink_) This would be racey if CompositorImpl can ...
3 years, 8 months ago (2017-04-04 22:14:47 UTC) #56
Saman Sami
https://codereview.chromium.org/2757373002/diff/160001/content/browser/renderer_host/compositor_impl_android.cc File content/browser/renderer_host/compositor_impl_android.cc (right): https://codereview.chromium.org/2757373002/diff/160001/content/browser/renderer_host/compositor_impl_android.cc#newcode809 content/browser/renderer_host/compositor_impl_android.cc:809: if (!has_compositor_frame_sink_) On 2017/04/04 22:14:47, danakj wrote: > This ...
3 years, 8 months ago (2017-04-04 22:23:47 UTC) #57
Saman Sami
PTAL. I added weak pointers for both single and multi threaded case.
3 years, 8 months ago (2017-04-05 16:02:59 UTC) #68
danakj
Thanks, looks good! Can you add unit tests that verify the cases that we invalidate ...
3 years, 8 months ago (2017-04-05 16:08:49 UTC) #69
Saman Sami
PTAL. Android passes and I added a test.
3 years, 8 months ago (2017-04-18 20:32:50 UTC) #86
danakj
Thanks! The test looks great. A couple last comments https://codereview.chromium.org/2757373002/diff/340001/cc/test/test_hooks.h File cc/test/test_hooks.h (right): https://codereview.chromium.org/2757373002/diff/340001/cc/test/test_hooks.h#newcode64 cc/test/test_hooks.h:64: ...
3 years, 8 months ago (2017-04-18 20:58:42 UTC) #90
Saman Sami
Thanks for the comments! PTAL. https://codereview.chromium.org/2757373002/diff/340001/cc/test/test_hooks.h File cc/test/test_hooks.h (right): https://codereview.chromium.org/2757373002/diff/340001/cc/test/test_hooks.h#newcode64 cc/test/test_hooks.h:64: virtual void WillReceiveCompositorFrameAckOnImplThread() {} ...
3 years, 8 months ago (2017-04-18 21:37:14 UTC) #93
danakj
https://codereview.chromium.org/2757373002/diff/360001/cc/trees/layer_tree_host_unittest.cc File cc/trees/layer_tree_host_unittest.cc (right): https://codereview.chromium.org/2757373002/diff/360001/cc/trees/layer_tree_host_unittest.cc#newcode7528 cc/trees/layer_tree_host_unittest.cc:7528: MainThreadTaskRunner()->PostDelayedTask( Thanks! LGTM One suggestion is pretend you are ...
3 years, 8 months ago (2017-04-18 21:52:34 UTC) #94
Saman Sami
Thanks for the LGTM. PTAL if you can. I updated the test as we discussed ...
3 years, 8 months ago (2017-04-19 03:07:38 UTC) #110
danakj
LGTM https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc File cc/trees/layer_tree_host_unittest.cc (right): https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc#newcode7514 cc/trees/layer_tree_host_unittest.cc:7514: void PrepareNextCommit() { nit: I think the standard ...
3 years, 8 months ago (2017-04-19 14:36:28 UTC) #111
Saman Sami
https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc File cc/trees/layer_tree_host_unittest.cc (right): https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc#newcode7514 cc/trees/layer_tree_host_unittest.cc:7514: void PrepareNextCommit() { On 2017/04/19 14:36:28, danakj wrote: > ...
3 years, 8 months ago (2017-04-19 15:00:15 UTC) #114
danakj
https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc File cc/trees/layer_tree_host_unittest.cc (right): https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc#newcode7514 cc/trees/layer_tree_host_unittest.cc:7514: void PrepareNextCommit() { On 2017/04/19 15:00:15, Saman Sami wrote: ...
3 years, 8 months ago (2017-04-19 15:23:02 UTC) #115
Saman Sami
https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc File cc/trees/layer_tree_host_unittest.cc (right): https://codereview.chromium.org/2757373002/diff/400001/cc/trees/layer_tree_host_unittest.cc#newcode7514 cc/trees/layer_tree_host_unittest.cc:7514: void PrepareNextCommit() { On 2017/04/19 15:23:01, danakj wrote: > ...
3 years, 8 months ago (2017-04-19 15:45:30 UTC) #116
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2757373002/460001
3 years, 8 months ago (2017-04-19 15:46:11 UTC) #119
commit-bot: I haz the power
3 years, 8 months ago (2017-04-19 16:51:14 UTC) #122
Message was sent while issue was closed.
Committed patchset #23 (id:460001) as
https://chromium.googlesource.com/chromium/src/+/44b6dfc95bd4a7b8240b81720b98...

Powered by Google App Engine
This is Rietveld 408576698