[flutter_tools] catch SocketException writing to ios-deploy stdin#139784
Merged
auto-submit[bot] merged 8 commits intoflutter:masterfrom Dec 12, 2023
Merged
[flutter_tools] catch SocketException writing to ios-deploy stdin#139784auto-submit[bot] merged 8 commits intoflutter:masterfrom
auto-submit[bot] merged 8 commits intoflutter:masterfrom
Conversation
| try { | ||
| // Stop the app, which will prompt the backtrace to be printed for all threads in the stdoutSubscription handler. | ||
| _iosDeployProcess?.stdin.writeln(_signalStop); | ||
| } on SocketException catch (error) { |
Contributor
Author
There was a problem hiding this comment.
This would never catch because the exception would be thrown in a different zone
| return _stdinWriteFuture; | ||
| } | ||
|
|
||
| Future<void> detach() async { |
Contributor
Author
There was a problem hiding this comment.
I made this async for the benefit of the unit tests. The two non-test calls to this method do not await the future.
jmagman
reviewed
Dec 11, 2023
jmagman
reviewed
Dec 11, 2023
jmagman
approved these changes
Dec 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 12, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 12, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 12, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 12, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 12, 2023
christopherfujino
added a commit
to chris-forks/flutter
that referenced
this pull request
Dec 12, 2023
…utter#139784) Fixes flutter#139709 This adds a static helper method `ProcessUtils.writelnToStdinGuarded()`, which will asynchronously write to a sub-process's STDIN `IOSink` and catch errors. In talking with Brian, it sounds like this is the best and most reliable way to catch `SocketException`s during these writes *to sub-process file descriptors* specifically (with a "real" hard drive file, the future returned by `.flush()` should complete with the write error). Also, as I note in the dartdoc to `writelnToStdinGuarded()`, the behavior seems to be different between macOS and linux. Moving forward, in any place where we want to catch exceptions writing to STDIN, we will want to use this new helper.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 13, 2023
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Dec 13, 2023
Roll Flutter from 9719097 to 11a9cb7 (32 revisions) flutter/flutter@9719097...11a9cb7 2023-12-13 [email protected] Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal (flutter/flutter#139549) 2023-12-12 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.22.9 to 2.22.10 (flutter/flutter#140003) 2023-12-12 [email protected] Allow plugins to use compileSdkPreview (flutter/flutter#131901) 2023-12-12 [email protected] Roll pub packages (flutter/flutter#139995) 2023-12-12 [email protected] Select simulator runtime for tests based on Xcode's preferred runtime build (flutter/flutter#139919) 2023-12-12 [email protected] Roll Flutter Engine from 0c527aa1a215 to 9039ac78cf03 (1 revision) (flutter/flutter#139992) 2023-12-12 [email protected] [Docs] Added missing `CupertinoApp.showSemanticsDebugger` (flutter/flutter#139913) 2023-12-12 [email protected] Roll Flutter Engine from 444281eb5c7c to 0c527aa1a215 (2 revisions) (flutter/flutter#139985) 2023-12-12 [email protected] Update Gallery lockfiles for the new version of the video_player plugin (flutter/flutter#139832) 2023-12-12 [email protected] Roll Packages from cb6dbcd to 80aa46a (5 revisions) (flutter/flutter#139982) 2023-12-12 [email protected] Roll Flutter Engine from 3b77b1b7b42f to 444281eb5c7c (1 revision) (flutter/flutter#139979) 2023-12-12 [email protected] Roll Flutter Engine from f8e87ed193f5 to 3b77b1b7b42f (1 revision) (flutter/flutter#139977) 2023-12-12 [email protected] Roll pub packages (flutter/flutter#139969) 2023-12-12 [email protected] Roll Flutter Engine from 4102c7daf1d3 to f8e87ed193f5 (3 revisions) (flutter/flutter#139963) 2023-12-12 [email protected] Roll Flutter Engine from 95dfb1d4ac75 to 4102c7daf1d3 (1 revision) (flutter/flutter#139961) 2023-12-12 [email protected] Roll Flutter Engine from 40bfd2dc1519 to 95dfb1d4ac75 (1 revision) (flutter/flutter#139959) 2023-12-12 [email protected] Roll Flutter Engine from 061ae7023f10 to 40bfd2dc1519 (2 revisions) (flutter/flutter#139958) 2023-12-12 [email protected] Roll Flutter Engine from 75cfb050cd9a to 061ae7023f10 (1 revision) (flutter/flutter#139955) 2023-12-12 [email protected] Roll Flutter Engine from 362d0cb3ab27 to 75cfb050cd9a (1 revision) (flutter/flutter#139954) 2023-12-12 [email protected] Fix dayPeriodColor handling of non-MaterialStateColors (flutter/flutter#139845) 2023-12-12 [email protected] Roll Flutter Engine from ea1a3069e057 to 362d0cb3ab27 (1 revision) (flutter/flutter#139951) 2023-12-12 [email protected] [github actions] Automate Flutter Chery Picks (flutter/flutter#139524) 2023-12-12 [email protected] Roll Flutter Engine from d001419b436e to ea1a3069e057 (5 revisions) (flutter/flutter#139948) 2023-12-12 [email protected] [flutter_tools] catch SocketException writing to ios-deploy stdin (flutter/flutter#139784) 2023-12-11 [email protected] [ci.yaml] Add missing ci.yaml to runIf of android hot reload tests (flutter/flutter#139932) 2023-12-11 [email protected] make the tar c command in prepare_package.dart verbose (flutter/flutter#139687) 2023-12-11 [email protected] Roll Flutter Engine from 5c1f13e1e535 to d001419b436e (4 revisions) (flutter/flutter#139941) 2023-12-11 [email protected] fix typo of 'not' instead of 'now' for `useInheritedMediaQuery` (flutter/flutter#139940) 2023-12-11 [email protected] Roll Flutter Engine from 4c309195b79d to 5c1f13e1e535 (2 revisions) (flutter/flutter#139939) 2023-12-11 [email protected] Implement `switch` expressions in `examples/` and `animation/` (flutter/flutter#139882) 2023-12-11 [email protected] Renamed `appbar` to `app_bar` directory in API Examples Tests (flutter/flutter#139922) 2023-12-11 [email protected] Deprecate `RawKeyEvent`, `RawKeyboard`, et al. (flutter/flutter#136677) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md ...
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #139709
This adds a static helper method
ProcessUtils.writelnToStdinGuarded(), which will asynchronously write to a sub-process's STDINIOSinkand catch errors.In talking with Brian, it sounds like this is the best and most reliable way to catch
SocketExceptions during these writes to sub-process file descriptors specifically (with a "real" hard drive file, the future returned by.flush()should complete with the write error).Also, as I note in the dartdoc to
writelnToStdinGuarded(), the behavior seems to be different between macOS and linux.Moving forward, in any place where we want to catch exceptions writing to STDIN, we will want to use this new helper.