Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
ac791adb
Unverified
Commit
ac791adb
authored
Jun 01, 2022
by
Christopher Fujino
Committed by
GitHub
Jun 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] flutter daemon handles a closed stdout IOSink (#105075)
parent
feda45a5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
daemon.dart
packages/flutter_tools/lib/src/daemon.dart
+4
-0
daemon_test.dart
packages/flutter_tools/test/general.shard/daemon_test.dart
+14
-0
No files found.
packages/flutter_tools/lib/src/daemon.dart
View file @
ac791adb
...
@@ -219,6 +219,10 @@ class DaemonStreams {
...
@@ -219,6 +219,10 @@ class DaemonStreams {
if
(
binary
!=
null
)
{
if
(
binary
!=
null
)
{
_outputSink
.
add
(
binary
);
_outputSink
.
add
(
binary
);
}
}
}
on
StateError
catch
(
error
)
{
_logger
.
printError
(
'Failed to write daemon command response:
$error
'
);
// Failed to send, close the connection
_outputSink
.
close
();
}
on
IOException
catch
(
error
)
{
}
on
IOException
catch
(
error
)
{
_logger
.
printError
(
'Failed to write daemon command response:
$error
'
);
_logger
.
printError
(
'Failed to write daemon command response:
$error
'
);
// Failed to send, close the connection
// Failed to send, close the connection
...
...
packages/flutter_tools/test/general.shard/daemon_test.dart
View file @
ac791adb
...
@@ -364,6 +364,20 @@ void main() {
...
@@ -364,6 +364,20 @@ void main() {
await
daemonStreams
.
dispose
();
await
daemonStreams
.
dispose
();
expect
(
outputStream
.
isClosed
,
true
);
expect
(
outputStream
.
isClosed
,
true
);
});
});
testWithoutContext
(
'handles sending to a closed sink'
,
()
async
{
// Unless the stream is listened to, the call to .close() will never
// complete
outputStream
.
stream
.
listen
((
List
<
int
>
_
)
{});
await
outputStream
.
sink
.
close
();
daemonStreams
.
send
(
testCommand
);
expect
(
bufferLogger
.
errorText
,
contains
(
'Failed to write daemon command response: Bad state: Cannot add event after closing'
,
),
);
});
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment