Skip to content
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

[flutter_tools] flutter daemon handles a closed stdout IOSink #105075

Merged

Conversation

christopherfujino
Copy link
Member

@christopherfujino christopherfujino commented Jun 1, 2022

Fixes #99367

In the stacktrace from crash logging, the IOSink is coming from STDOUT.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 1, 2022
@christopherfujino christopherfujino marked this pull request as ready for review June 1, 2022 00:24
@@ -219,6 +219,10 @@ class DaemonStreams {
if (binary != null) {
_outputSink.add(binary);
}
} on StateError catch (error) {
_logger.printError('Failed to write daemon command response: $error');
Copy link
Member Author

Choose a reason for hiding this comment

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

@zanderso Actually, if we're running in the daemon context and STDOUT is closed, should we just tool exit since the IDE plugin isn't listening anyway?

Copy link
Member

Choose a reason for hiding this comment

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

It may happen already as a consequence of closing _outputSink. But otherwise, probably yeah.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think you're right, in playing around with this, I can't get it to leak the tool process, so I think we're good

@@ -219,6 +219,10 @@ class DaemonStreams {
if (binary != null) {
_outputSink.add(binary);
}
} on StateError catch (error) {
_logger.printError('Failed to write daemon command response: $error');
Copy link
Member

Choose a reason for hiding this comment

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

It may happen already as a consequence of closing _outputSink. But otherwise, probably yeah.

@fluttergithubbot fluttergithubbot merged commit ac791ad into flutter:master Jun 1, 2022
@christopherfujino christopherfujino deleted the fix-flutter-daemon branch June 1, 2022 20:59
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
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.

[flutter_tools] Bad state: StreamSink is closed
3 participants