Skip to content

Initialize new isolate after restart #1305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

annagrin
Copy link
Contributor

Dart devtools sometimes gets erroneous isolate information from dwds in the middle of hot restart,
for example, getIsolate does not wait for initializations of the new isolate after restart and returns
an isolate with null ID.

This seems to cause various issues after hot restart, including exceptions in debug console, non-working
layout explorer, and disabled breakpoints in the UI. While this PR does not solve all of them yet, it makes
sure that the new isolate is initialized before VM replies to the clients after hot restart:

  • reset initialization completer on destroyIsolate.
  • make all supported VM API wait for isolate initialization before proceeding.
  • add expression evaluation tests after hot restart.

Towards: flutter/flutter#74903
Closes: #1304

- reset initialization completer on `destroyIsolate`
  so correct signal is set after `createIsolate`
- make all supported VM API wait for isolate initizaliation
  before proceeding.

Towards:flutter/flutter#74903
@google-cla google-cla bot added the cla: yes label Apr 15, 2021
@annagrin annagrin requested review from grouma and bkonyi April 15, 2021 00:27
Copy link
Collaborator

@bkonyi bkonyi left a comment

Choose a reason for hiding this comment

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

LGTM!

@annagrin annagrin requested a review from grouma April 16, 2021 02:06
@annagrin
Copy link
Contributor Author

annagrin commented Apr 16, 2021

@grouma re-requesting approval after my latest commit - my fix attempt did not work, as shown by windows test failures, where isolate was marked as initialized and expression evaluation was starting before updateDependencies was even called.

Instead, I made evaluate and evaluateInFrame calls wait until expression compiler is created, initialized, and dependencies are updated, which can be only done from ChromeProxyService. Reverted my changes in ExpressionCompilerService, as it does not have enough information to make sure we compile expressions after dependency updates.

@annagrin annagrin merged commit ffa619e into dart-lang:master Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dwds VM Service API do not wait for isolate initialization after hot restart
3 participants