From e6e8693c0c5d546f75f658a5efa6267548f82b00 Mon Sep 17 00:00:00 2001 From: Dangyi Liu Date: Tue, 28 Jun 2022 11:21:42 -0700 Subject: [PATCH] [fuchsia] Close runtime_dir when launching components (flutter/engine#34342) The runner is supposed to either serve the runtime_dir, or close the channel immediately. Otherwise consumers will get blocked indefinitely. BUG: fxbug.dev/103480 --- .../fuchsia/dart_runner/dart_component_controller_v2.cc | 4 ++++ .../fuchsia/dart_runner/dart_test_component_controller_v2.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller_v2.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller_v2.cc index 31bec7d29e..043a70a052 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller_v2.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller_v2.cc @@ -133,6 +133,10 @@ DartComponentControllerV2::DartComponentControllerV2( idle_wait_.set_trigger(ZX_TIMER_SIGNALED); idle_wait_.Begin(async_get_default_dispatcher()); } + + // Close the runtime_dir channel if we don't intend to serve it. Otherwise any + // access to the runtime_dir will hang forever. + start_info_.clear_runtime_dir(); } DartComponentControllerV2::~DartComponentControllerV2() { diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller_v2.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller_v2.cc index f22dcb6b74..92f51aa392 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller_v2.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller_v2.cc @@ -136,6 +136,10 @@ DartTestComponentControllerV2::DartTestComponentControllerV2( idle_wait_.set_trigger(ZX_TIMER_SIGNALED); idle_wait_.Begin(async_get_default_dispatcher()); } + + // Close the runtime_dir channel if we don't intend to serve it. Otherwise any + // access to the runtime_dir will hang forever. + start_info_.clear_runtime_dir(); } DartTestComponentControllerV2::~DartTestComponentControllerV2() {