Skip to content

Conversation

@DanTup
Copy link
Contributor

@DanTup DanTup commented Nov 10, 2021

This is a (proper) fix for Dart-Code/Dart-Code#3448. The issue is that during a hot restart, all existing isolates must exit. There was existing code to resume them, and remove all breakpoints (so they don't get stuck), however they were still able to pause on exceptions if the user had enabled this.

This change removes the pause-on-exception behaviour in addition to the breakpoints. A previous fix for this was implemented in Dart-Code's DAP, but that was VS Code-specific, and VS Code will soon move to the Flutter SDK DAP so it needed either reproducing in the DAP or here (here makes more sense because it's the same issue as breakpoints, and the DAP base classes don't currently expose a way to set this only for specific isolates).

This is safe to do because editors need to set this flag per-isolate anyway, so when these isolates disappear and new ones are created, the editors will already re-send this setting.

Fixes Dart-Code/Dart-Code#3448.
Fixes Dart-Code/Dart-Code#3631.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 10, 2021
@google-cla google-cla bot added the cla: yes label Nov 10, 2021
@DanTup
Copy link
Contributor Author

DanTup commented Nov 10, 2021

The remaining test failures seem to be races, where if we terminate the app while startup code is running (which happens here because we hot restart, then immediately terminate and things are coming back), some errors occur because in-flight requests are aborted as the VM Service shuts down.

I'll take a look tomorrow - I suspect the fix will be to ignore these types of error ("Service has disappeared") that if we know we're already shutting down.

@DanTup
Copy link
Contributor Author

DanTup commented Nov 11, 2021

Tests all green now 👍

@DanTup
Copy link
Contributor Author

DanTup commented Nov 18, 2021

@christopherfujino not urgent, but in case you missed this :-)

@christopherfujino
Copy link
Contributor

@christopherfujino not urgent, but in case you missed this :-)

Thanks, I did (miss this).

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@DanTup
Copy link
Contributor Author

DanTup commented Nov 18, 2021

Thanks!

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

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply hot-restart fix to Flutter DAP Hot Restart does not complete if exceptions are hit during the restart

3 participants