Skip to content

During hot-restart, wait to run main when pause_isolates_on_start is true - #2378

Merged
elliette merged 9 commits into
dart-lang:masterfrom
elliette:wait-run-main
Mar 5, 2024
Merged

elliette merged 9 commits into
dart-lang:masterfrom
elliette:wait-run-main

Conversation

@elliette

@elliette elliette commented Feb 29, 2024 •

Copy link
Copy Markdown
Contributor

During a hot-restart, if pause_isolates_on_start is true, DWDS waits for a call to resume before running the app's main method. This gives the debugging client time to re-set any breakpoints before the app is run.

When using RequireStrategy (flutter, webdev):

  • dwds/web/reloader/require_restarter.dart waits for the readyToRunMain future before calling the main method

When using DdcStrategy (g3):

Work towards flutter/devtools#7231

@elliette elliette changed the title [Draft] Tell DDC to wait for a resume event to run main After hot-restart, DDC waits for a resume event to run main Mar 4, 2024
@elliette elliette changed the title After hot-restart, DDC waits for a resume event to run main Tell DDC to wait to run main when pause_isolates_on_start is true Mar 4, 2024
@elliette elliette changed the title Tell DDC to wait to run main when pause_isolates_on_start is true Tell DDC to wait to run main when pause_isolates_on_start is true (webdev, g3) Mar 4, 2024
@elliette elliette changed the title Tell DDC to wait to run main when pause_isolates_on_start is true (webdev, g3) Tell DDC to wait to run main when pause_isolates_on_start is true Mar 5, 2024
@elliette elliette changed the title Tell DDC to wait to run main when pause_isolates_on_start is true Wait to run main when pause_isolates_on_start is true Mar 5, 2024
@elliette
elliette requested review from Markzipan and nshahan March 5, 2024 18:17
@elliette elliette changed the title Wait to run main when pause_isolates_on_start is true During hot-restart, wait to run main when pause_isolates_on_start is true Mar 5, 2024
@nshahan

nshahan commented Mar 5, 2024

Copy link
Copy Markdown
Contributor

Note: requires https://dart-review.googlesource.com/c/sdk/+/355880 - question: is this script used in any configuration?

Currently it is used by the expression compiler tests on the ddc test configurations in the SDK and it is also used by the benchmarking infra when running code with DDC. There is a very minor test in the SDK that runs on the benchmark-linux config that ensures we don't totally break the pieces the benchmark infra relies on.

We will be adding more configs and tests in the near future though.

@nshahan nshahan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again work walking me through these changes. LGTM but we will need to revisit in the future to reduce the size of the window between clearing breakpoints and resetting them when were ready to support a stateful hot reload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants