Skip to content

Commit 61b80d1

Browse files
bkonyicommit-bot@chromium.org
authored andcommitted
[ package:dds ] Add 30 second keep alive period for SSE connections
Uberproxy actively kills long standing connections after a set period of time. This change adds a 30 second keep alive period for SSE connections so connections can be reestablished after being killed by Uberproxy without DDS assuming the connection has disappeared. Change-Id: I18363da475bc5d785f85f5ffbec4102a2b7941af Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183141 Reviewed-by: Gary Roumanis <[email protected]> Commit-Queue: Ben Konyi <[email protected]>
1 parent c723dae commit 61b80d1

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

pkg/dds/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.7.5
2+
- Add 30 second keep alive period for SSE connections.
3+
14
# 1.7.4
25
- Update `package:vm_service` to 6.0.1-nullsafety.0.
36

pkg/dds/lib/src/dds_impl.dart

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,18 @@ class DartDevelopmentServiceImpl implements DartDevelopmentService {
231231
});
232232

233233
Handler _sseHandler() {
234+
// Give connections time to reestablish before considering them closed.
235+
// Required to reestablish connections killed by UberProxy.
236+
const keepAlive = Duration(seconds: 30);
234237
final handler = authCodesEnabled
235-
? SseHandler(Uri.parse('/$_authCode/$_kSseHandlerPath'))
236-
: SseHandler(Uri.parse('/$_kSseHandlerPath'));
238+
? SseHandler(
239+
Uri.parse('/$_authCode/$_kSseHandlerPath'),
240+
keepAlive: keepAlive,
241+
)
242+
: SseHandler(
243+
Uri.parse('/$_kSseHandlerPath'),
244+
keepAlive: keepAlive,
245+
);
237246

238247
handler.connections.rest.listen((sseConnection) {
239248
final client = DartDevelopmentServiceClient.fromSSEConnection(

pkg/dds/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: >-
33
A library used to spawn the Dart Developer Service, used to communicate with
44
a Dart VM Service instance.
55
6-
version: 1.7.4
6+
version: 1.7.5
77

88
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/dds
99

0 commit comments

Comments
 (0)