Commit Graph

41 Commits

Author SHA1 Message Date
Ben Konyi 96cf91bea3 [ package:dds ] Update DDS dependencies and set SDK requirement to >=2.12
Also updated non-migrated libraries to include @dart=2.10.

Change-Id: Idcf4e54f9aa37b9b016133144af594cc932418a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192122
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-03-19 19:49:08 +00:00
Nate Bosch 7b4263c2b3 Update to the latest package:sse
Change-Id: I8f2f25a72f459fbea4fdd9bf4e81a7d6f5704a50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183182
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-02-05 20:57:38 +00:00
Ben Konyi 61b80d1b39 [ 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 <grouma@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-02-05 19:31:58 +00:00
Ben Konyi 6349ce0436 [ DDS ] Update package:vm_service dep to 6.0.1-nullsafety.0
Change-Id: I34c9d9f542fd896af742fd246c7111029c44daec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180606
Reviewed-by: Dan Field <dnfield@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-22 22:03:07 +00:00
Ben Konyi a7c9e24aef [ package:dds ] Return a RpcException error with kServiceDisappeared
code if DDS loses connection to the VM service while forwarding a
request.

Change-Id: I9bb2adc160f25658756cc7106b77cbcd3b9ccc27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180090
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-20 00:01:55 +00:00
Ben Konyi 6de68d541a [ package:dds ] Fix issue where handling a StateError due to a VM
service connection loss could result in a null JSON RPC response.

This would cause package:vm_service to throw a NoSuchMethodError as it
currently assumes it will never receive a null result in a JSON RPC
response.

Related to https://github.com/flutter/flutter/issues/74051.

Change-Id: I86c1c9f7e46e34519f32dfed589c6b31aed39d7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179800
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-17 23:08:18 +00:00
Ben Konyi ef7e0810f2 [ package:dds ] Fix instance where DartDevelopmentServiceException could
have a null message

Change-Id: I03e800aeef82ce536e768b8da6ba274d89486bb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179367
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-15 01:42:40 +00:00
Ben Konyi 34b4c914a4 [ DDS ] Add getStreamHistory RPC and package:vm_service extensions
Adds a DDS RPC which allows for stream history to be manually requested
in addition to being sent upon initial stream subscription.

Also adds an initial implementation of
package:dds/vm_service_extensions.dart, which adds DDS functionality to
the `VmService` class.

Fixes https://github.com/dart-lang/sdk/issues/44505

Change-Id: I198a6fd7fca15f131a6fdd95e7860a6f98ef06a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177182
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-12-30 02:30:15 +00:00
Ben Konyi fc892d7fca [ package:dds ] Handle StateError when VM service disappears
Fixes https://github.com/flutter/flutter/issues/70579

Change-Id: Ic32acaa038afcf67c98b77d20fd39d136bec13b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175163
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
2020-12-05 01:19:12 +00:00
Ben Konyi a157ddbf94 [ DDS ] Add errorCode to DartDevelopmentServiceException to better
communicate reason for error

Change-Id: I5041558ad6370f873dc23515fdad1ec8a2cf4ba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172880
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-18 23:45:41 +00:00
Ben Konyi c36ba8b50c [ package:dds ] Improve DDS error handling, add tests
Added tests to try and emulate failures reported in flutter_tools crash
reports. Used these tests to update error handling and get a better
understanding of exception scenarios.

Change-Id: Ie72822dafcc6373ebfeea543d93b934c0d0687f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172420
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-17 00:00:45 +00:00
Ben Konyi d2775733a6 Reland "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit a486752050.

Change-Id: I112a907792b5cbfd4a1ee0eb96898dc931c92f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170480
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-06 19:02:23 +00:00
Ben Konyi a486752050 Revert "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit 892cc93f26.

Reason for revert: Causing assertion failures on pkg-linux-debug

Original change's description:
> [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
>
> Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
> Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,kenzieschmoll@google.com

Change-Id: Idf2a5f07433af0772ef36aaa2ba7b24b1a5e0323
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170300
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-04 00:25:37 +00:00
Ben Konyi 892cc93f26 [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-03 19:09:47 +00:00
Ben Konyi fafc1bdb85 [ VM Service / DDS ] Forward 'evaluate' and 'evaluateInFrame' requests to VM Service
Changes DDS from invoking the VM's private compilation RPCs directly
when an external compilation service is not present. This resulted in
expression evaluation failing when the VM Service implementation was
DWDS.

Change-Id: I889774f0f2e133307f490b586a68ebe609096b49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165680
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-01 19:00:20 +00:00
Ben Konyi 154e885bd4 [ package:dds ] Cleanup error handling for early shutdown cases
Fixes situation where confusing errors were thrown when DDS was shut
down while starting up (e.g., StateError from in-flight requests,
WebSocket exceptions due to the VM service disappearing, etc).

Change-Id: I8293eaf4a176d9258fc2c794d595dc926711f31a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164601
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-28 16:46:56 +00:00
Ben Konyi b5f688e938 [ package:dds ] Send ServiceRegistered events on Service stream subscription
The VM service sends ServiceRegistered events for each registered
service to each client when they first subscribe to the Service stream.
DDS was not mimicking this behavior correctly.

Change-Id: I5e49796200bfff37b8bfc210cbbf714f4a7a43d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163263
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-17 18:58:23 +00:00
Ben Konyi 437eeb778e [ package:dds ] Don't assume isolateIds take form of 'isolates/123'
DWDS doesn't use the `isolates/$id` scheme for its isolate IDs which was
causing an exception to be thrown when resuming an isolate.

Change-Id: Id1b81895ea942da8bcb4c10edb83128469e2793c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162941
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-15 17:20:01 +00:00
Ben Konyi 1c21e4763a [ package:dds ] Fix sseUri not returning a URI with a 'sse' scheme
Change-Id: I323f6a4bec959b63c5dbd95b577cc22c79c8548a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162061
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-10 16:44:10 +00:00
Ben Konyi b782d09afd Reland "[ package:dds ] Add IPv6 support; 1.3.2 release"
This reverts commit c9182ad3c0.

Change-Id: I5e00c7f5138fbff0e54aab599a2548fa1f3146ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161561
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-03 20:21:07 +00:00
Ben Konyi c9182ad3c0 Revert "[ package:dds ] Add IPv6 support; 1.3.2 release"
This reverts commit 23f80fb7fd.

Reason for revert: https://github.com/dart-lang/sdk/issues/43292

Original change's description:
> [ package:dds ] Add IPv6 support; 1.3.2 release
> 
> Change-Id: I62ca85c2340d8c91fd2f08c945bf981ac36adad3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161400
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I30f1485ef573d5f2f9c7bebcfc3ef800e344fac1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161450
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-09-02 02:56:24 +00:00
Ben Konyi 23f80fb7fd [ package:dds ] Add IPv6 support; 1.3.2 release
Change-Id: I62ca85c2340d8c91fd2f08c945bf981ac36adad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-01 23:36:41 +00:00
Devon Carew 8a0b75ced1 update the pubspec files to reflect actual package usage
Change-Id: I1fa259d0a9e827c7491312ce2e5ffe8261147038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159142
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-08-19 19:40:47 +00:00
Nate Bosch 3b6aeb43fa Handle StateError for closed serviceClient
In https://github.com/dart-lang/json_rpc_2/pull/52 the `Peer` class was
fixed to behave like a `Client` when the connection is closed with
outstanding requests.

`package:dds` was previously relying on having the futures never
complete to send the `serviceDisappeared` code when the client was
closed with outstanding requests. Check also for the `StateError` that
would result from outstanding requests and translate them to
`serviceDisappeared`.

Change-Id: I2d3f186d1d52d34082b7adf5bf962e22df74015b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158220
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-08-12 16:17:04 +00:00
Ben Konyi 3450026c21 [ package:dds ] Fixed issue where an exception could be thrown during startup if the target
process had an isolate without an associated pause event.

Change-Id: I2c833335129d120aec84e3a2327d1f10560fe186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155145
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-21 17:56:44 +00:00
Ben Konyi 1e78bd069e [ package:dds ] Add missing package:shelf_static dependency in
pubspec.yaml

Change-Id: Ifd7954d66bd8af2f74d5e718d2dc6f5ccc1f738f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154564
Reviewed-by: Zichang Guo <zichangguo@google.com>
2020-07-15 21:42:11 +00:00
Ben Konyi e7b319698d [ package:dds ] Add server-sent event (SSE) support to DDS
This support is required for web clients of dwds within google3

Change-Id: Ia1ecbf8f5ba79d53cb340c83a579dc0810ec0065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150183
Reviewed-by: Gary Roumanis <grouma@google.com>
2020-07-15 21:30:09 +00:00
Ben Konyi 505fca1ce5 [ package:dds ] Fix issue where StateError could be thrown if DDS shuts
down with in-flight requests

Related to https://dart-review.googlesource.com/c/sdk/+/154288

Change-Id: Ica7558d1abb0caec341c3dd93953240005c05a6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154560
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-15 21:11:46 +00:00
Ben Konyi b75df6f268 [ package:dds ] Fixed expression evaluator expecting a double-nested
'result' from an external 'compileExpression' implementation

Also adds expression evaluation tests for external clients.

Change-Id: Ibc1ee098df1de4d191627cbccb44e24fbcb43adf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-14 00:32:49 +00:00
Ben Konyi 28cd9ff533 [ package:dds ] Fix issue where StateError could be raised when a
client disconnects from DDS after the VM service has shutdown

Change-Id: I4f6734a125a622ff5042e39e00a1110bbe67d155
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154288
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-13 23:03:09 +00:00
Ben Konyi c54ec8d5f3 [ package:dds ] Handle expression evaluation invocations in DDS and forward compileExpression calls to clients which provide their own compilation service.
Change-Id: I2daec26929ad4f530d28d0073a0b2758850bec0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150694
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-06-11 22:43:39 +00:00
Ben Konyi da7e14a716 [ package:dds ] 1.2.0 release
Change-Id: I86eb6da074f8f3c482fbdc741993494348d125cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150670
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-09 23:24:36 +00:00
Ben Konyi 01fd2c480e [ package:dds ] Allow for JSON-RPC 2.0 requests which are missing the jsonrpc parameter
Fixes https://github.com/dart-lang/sdk/issues/41942

Change-Id: Ibbe560a70ba7b6ab1d09d46fada3f1738ea425a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148512
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-18 23:00:49 +00:00
Ben Konyi 54fb6ce3c0 [ Service / DDS ] Prepare for package:dds publishing
Final cleanup work before first full version of package:dds is
published:

- Added `getSupportedProtocols` RPC to the VM service protocol, which returns a
  list of supported service protocols and extensions along with their version
  information.
- Added `getDartDevelopmentServiceVersion` RPC to the DDS protocol.
- Misc code and dependency cleanup recommended by pub

Change-Id: If1bdf46852778adf31242122665c36b63106ad44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148224
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-15 22:52:12 +00:00
Ben Konyi 755a315dc5 [ package:dds ] Added support for log history in DDS
Added the following RPCs to the DDS protocol:
- getLogHistoryLength
- setLogHistoryLength

Historical logs will be sent to clients when they connect and subscribe
to the Logging stream for the first time. Current default log history
length is 10,000 messages to support applications with chatty logging at
startup.

Change-Id: Ic6cd9c58673fbb7179b6ac0f1f6581cb8ada03fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146444
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-08 23:30:36 +00:00
Ben Konyi 5b19445d9c Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
This reverts commit cccddf3530.

Change-Id: Iabde3542d5be33ffabf50efd9226597aef876ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143961
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-17 21:12:44 +00:00
Alexander Aprelev cccddf3530 Revert "Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests""
This reverts commit e5b85792da as it seems to have broken service/pause_on_start_and_exit_with_child_test/service https://ci.chromium.org/p/dart/builders/ci.sandbox/app-kernel-linux-debug-x64/5877

Change-Id: Idb9df51816eebfb58137c449c6461731c77409f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143881
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-16 23:37:25 +00:00
Ben Konyi e5b85792da Reland "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
Fixes buildbot failures by running VM service and DDS service tests in
separate test processes.

This reverts commit 1f0c90868c.

Change-Id: I0ad9b2e6ccea4d5468dd4dcdde0e286bcbf820ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142902
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-16 17:59:25 +00:00
Ben Konyi 1f0c90868c Revert "[ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests"
This reverts commit 6b2419ddaf.

Reason for revert: Failures on bots. Reverting.

Original change's description:
> [ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests
> 
> This change adds stream forwarding to the Dart Development Service,
> allowing for clients to subscribe to service protocol streams with DDS
> instead of the VM service directly. DDS will maintain a single
> subscription for each stream as long as at least one client is listening
> to that stream. A DDS stream subscription will be closed when the last
> client listening to that stream either disconnects or calls
> streamCancel.
> 
> This change also enables DDS for most of the Observatory services tests,
> excluding thoses which utilize:
> 
> - Service extensions
> - Client naming
> - Client isolate resume synchronization
> 
> Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I185e63eabca54a3dff49d4f5a8a126795cadfa80
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-08 00:07:38 +00:00
Ben Konyi 6b2419ddaf [ Service / package:dds ] Add stream support to package:dds and enable DDS for VM service tests
This change adds stream forwarding to the Dart Development Service,
allowing for clients to subscribe to service protocol streams with DDS
instead of the VM service directly. DDS will maintain a single
subscription for each stream as long as at least one client is listening
to that stream. A DDS stream subscription will be closed when the last
client listening to that stream either disconnects or calls
streamCancel.

This change also enables DDS for most of the Observatory services tests,
excluding thoses which utilize:

- Service extensions
- Client naming
- Client isolate resume synchronization

Change-Id: I5641e879a7626fcd5e4d28434ed480dd72fc7659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142083
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-07 23:18:45 +00:00
Ben Konyi a74e877104 [ package:dds ] Initial commit of the Dart Development Service, package:dds
- Defined initial interface
- Currently can spawn an HTTP server and forward websocket and HTTP
requests to the VM service
- Simple smoke tests
- Initial documentation in dds_protocol.md and other book keeping
- Enabled analysis on bots

Change-Id: Ia11e9e33fd10b0b4700b704a29e2977341441cec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139542
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-19 23:36:45 +00:00