-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CP-stable][ Hot Restart ] Fix possible hang due to unhandled exception in UI isolates on hot restart #166064
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
Conversation
…olates on hot restart (flutter#165693) Possible fix for flutter#161466
|
@bkonyi please fill out the PR description above, afterwards the release team will review this request. |
…e566617ff625e83e216e7217c2
…e566617ff625e83e216e7217c2
|
@bkonyi Please add a changelog entry following our changelog guidance. |
Done. |
CHANGELOG.md
Outdated
| ### [3.29.3](https://github.com/flutter/flutter/releases/tag/3.29.3) | ||
| - [flutter/165166](https://github.com/flutter/flutter/pull/165166) - Impeller, | ||
| All platforms, Text that is scaled over 48x renders incorrectly. | ||
| - [flutter/161466](https://github.com/flutter/flutter/pull/161466) - Fixed issue where hot restart could hang indefinitely if "Pause on Unhandled Exceptions" was enabled and a call to `Isolate.run` had not completed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkonyi This doesn't follow our changelog guidance.
Here is my best attempt at the entry.
| - [flutter/161466](https://github.com/flutter/flutter/pull/161466) - Fixed issue where hot restart could hang indefinitely if "Pause on Unhandled Exceptions" was enabled and a call to `Isolate.run` had not completed. | |
| - [flutter/161466](https://github.com/flutter/flutter/pull/161466) -When "Pause on Unhandled Exceptions" is enabled in VsCode hot restart can hang on all platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't solely a VSCode issue. How about:
Hot restart can hang on all platforms if "Pause on Unhandled Exceptions" is enabled by the debugger and a call to `Isolate.run` has not completed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a flutter dev I dont immediately understand what "and a call to Isolate.run has not completed" means or what that looks like to a user.
That said you are the author.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, there's a lot of entries in recent change logs that I don't understand as a Flutter developer... 😄
I think this is the simplest the description can be without losing important context.
|
autosubmit label was removed for flutter/flutter/166064, because Pull request flutter/flutter/166064 is not in a mergeable state. |
…e566617ff625e83e216e7217c2
|
autosubmit label was removed for flutter/flutter/166064, because - The status or check suite Linux framework_tests_widgets has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…e566617ff625e83e216e7217c2
cf56914
into
flutter:flutter-3.29-candidate.0
…ed exception in UI isolates on hot restart (flutter/flutter#166064)
…ed exception in UI isolates on hot restart (flutter/flutter#166064)
…ed exception in UI isolates on hot restart (flutter/flutter#166064)
…on in UI isolates on hot restart (flutter#166064) This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: flutter#161466 ### Changelog Description: [flutter/161466](flutter#161466): Fixed issue where hot restart could hang indefinitely if "Pause on Unhandled Exceptions" was enabled and a call to `Isolate.run` had not completed. ### Impact Description: Hot restart (and the Dart-Code extension) could end up in a bad state where hot restart never completes and interacting with the application via the Dart-Code extension doesn't work as expected. The application becomes unresponsive and must be fully restarted to continue development. `Isolate.run` is used to load license files in the background, meaning that users don't need to explicitly be spawning isolates to encounter this issue. ### Workaround: Is there a workaround for this issue? Explicitly disable "Pause on Unhandled Exceptions", which is typically enabled by default. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? 1. Create a Flutter project with the following `main.dart`: ```dart import 'dart:async'; import 'dart:developer'; import 'dart:isolate'; import 'package:flutter/material.dart'; void main() { WidgetsFlutterBinding.ensureInitialized().platformDispatcher.onError = (Object error, StackTrace? stack) { return true; }; runApp( const Center( child: Text( 'Hello, world!', key: Key('title'), textDirection: TextDirection.ltr, ), ), ); Isolate.run(() { print('COMPUTING'); debugger(); }); } ``` 2. Run the application in debug mode and perform a hot restart once `COMPUTING` appears on `stdout`. Hot restart should complete successfully.
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
#161466
Changelog Description:
flutter/161466: Fixed issue where hot restart could hang indefinitely if "Pause on Unhandled Exceptions" was enabled and a call to
Isolate.runhad not completed.Impact Description:
Hot restart (and the Dart-Code extension) could end up in a bad state where hot restart never completes and interacting with the application via the Dart-Code extension doesn't work as expected. The application becomes unresponsive and must be fully restarted to continue development.
Isolate.runis used to load license files in the background, meaning that users don't need to explicitly be spawning isolates to encounter this issue.Workaround:
Is there a workaround for this issue?
Explicitly disable "Pause on Unhandled Exceptions", which is typically enabled by default.
Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
main.dart:COMPUTINGappears onstdout. Hot restart should complete successfully.