Skip to content

Commit 69dbcff

Browse files
authored
Shutting down daemon process if build_runner throws. (#4274)
Consecutive execution of `webdev serve` when `build_runner` throws was causing an errant VM process to hold onto websocket connections, resulting in: ``` WebSocketChannelException: SocketException: Connection refused (OS Error: Connection refused, errno = 61), address = localhost, port = XXXXX ```
1 parent 1cf8a39 commit 69dbcff

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

build_daemon/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.1.1
2+
3+
- Bug fix: daemon process shuts down on internal error.
4+
15
## 4.1.0
26

37
- Bug fix: resolve symlinks when identifying workspaces, so symlinks can't

build_daemon/lib/client.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ class BuildDaemonClient {
195195
includeParentEnvironment: includeParentEnvironment,
196196
);
197197

198-
await _handleDaemonStartup(process, logHandler);
198+
try {
199+
await _handleDaemonStartup(process, logHandler);
200+
} catch (_) {
201+
process.kill();
202+
rethrow;
203+
}
199204

200205
return connectUnchecked(
201206
workingDirectory,

build_daemon/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_daemon
2-
version: 4.1.0
2+
version: 4.1.1
33
description: A daemon for running Dart builds.
44
repository: https://github.com/dart-lang/build/tree/master/build_daemon
55
resolution: workspace

0 commit comments

Comments
 (0)