Commit graph

210 commits

Author SHA1 Message Date
Devon Carew 13b1af4c2e [pkg/dds] refactor parts into private libraries
Change-Id: Ic104627b676119742606f7b34b025c6f0d093db0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176600
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-12-29 00:59:24 +00:00
Ben Konyi 22f82bce92 [ package:dds ] Regenerate sse_smoke_driver.dart.js
There was a syntax error in the generated code preventing the test from
completing.

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

Change-Id: Ifacfa0d9d3587ebfa52870372a35c1c2dbff4784
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176940
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-12-22 19:47:11 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +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 fe85812e27 [ VM / DartDev ] Fix --disable-service-auth-codes not being recognized by DDS
The VM and dartdev were not forwarding --disable-service-auth-codes to
the DDS instance, resulting in auth codes always being enabled.

Change-Id: Ib23bfeb7c64a51fb1229f049a4b61cb1ce5018de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163261
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-18 17:23:31 +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
Devon Carew 70eb699641 change the java impl of the vm service protocol library to support new major protocol versions
Change-Id: I0a954cbcf1103f999575f7d923037ae342f4256c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162140
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-09-09 16:04:09 +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 f0d88cc96d Reland "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit ed120c3c80.

Change-Id: I445f4bb2dafaad3ce2daa3ae42efe1723f9b1abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160660
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-03 15:20:14 +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
Ben Konyi ed120c3c80 Revert "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit 0ea18ffb36.

Reason for revert: Tree is on fire

Original change's description:
> [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
> 
> This change does the following:
>   - The DDS URI will be reported by the VM as the VM service URI. If DDS
>     disconnects, the VM service URI will be reported instead. This only
>     impacts the standalone VM.
>   - Updated the service protocol to 4.0 and removed the following
>     deprecated functionality:
>       - Client synchronization RPCs (these now live in DDS)
>       - getWebSocketTarget (no longer needed as the VM service no longer
>         tries to redirect web socket clients to DDS)
>   - Regenerates package:vm_service based on the new spec, prepare for
>     5.0 release
> 
> Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I6a16e9fa7ceb18555d6424a169cfa811d3833419
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-26 16:08:27 +00:00
Ben Konyi 0ea18ffb36 [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
This change does the following:
  - The DDS URI will be reported by the VM as the VM service URI. If DDS
    disconnects, the VM service URI will be reported instead. This only
    impacts the standalone VM.
  - Updated the service protocol to 4.0 and removed the following
    deprecated functionality:
      - Client synchronization RPCs (these now live in DDS)
      - getWebSocketTarget (no longer needed as the VM service no longer
        tries to redirect web socket clients to DDS)
  - Regenerates package:vm_service based on the new spec, prepare for
    5.0 release

Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-08-26 14:55:15 +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 6a66061703 [ Service ] Add getWebSocketTarget RPC to allow for Observatory to
connect to DDS without relying on a redirect.

Some WebSocket implementations (particularly dart:html's) don't follow
redirects and don't provide the user with the message returned by the
server.

This CL adds 'getWebSocketTarget' as an RPC which returns the
URI that should be used by the client to connect directly to the proper
web socket target. In addition, the "implicit-redirect" forwarding has
been removed.

Change-Id: Iaf88c965f6fedfa6f63c28a08860a3c80388797c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156485
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-03 22:06:41 +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 157ebfe50f Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit 7e373831ce.

Change-Id: Ib94d793a5753ec6352cd9a65e35f726a63336368
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154830
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-21 16:23:18 +00:00
Alexander Aprelev 7e373831ce Revert "Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process""
This reverts commit bc4cb123a8.

Reason for revert: breaks crossword simarm tests https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-linux-debug-simarm_x64/2619

Original change's description:
> Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)
> 
> This reverts commit 3849b5061c.
> 
> Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I649d94c668417f2edbfd7039fa5c876e10dc32fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154800
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-07-17 04:37:48 +00:00
Ben Konyi bc4cb123a8 Reland "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/42092)

This reverts commit 3849b5061c.

Change-Id: I4fd3ba33840771a9f284d733c4a25fac6cde64ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154706
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-07-17 00:54:11 +00:00
Ben Konyi 3849b5061c Revert "[ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process"
This reverts commit ffe258d2d4.

Reason for revert: Failures on bots

Original change's description:
> [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
> 
> This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.
> 
> By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:
> 
> VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
> Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
> Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)
> 
> Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: Idb1d24a4524bdc3ccfb199a82710f3c0d9db539a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154702
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-07-16 19:50:57 +00:00
Ben Konyi ffe258d2d4 [ VM / DartDev ] Launch DartDev in an isolate within a single main Dart process
This CL changes how DartDev is run and how the run command handles executing a Dart program (will port additional commands in a separate CL). Rather than using DartDev to spawn a child process to run user code, the VM will instead launch a DartDev isolate after doing some VM options processing. DartDev will communicate information like exit codes and script/arg pairs with the VM via isolate ports. Once DartDev runs to completion and notifies the VM that a script should be run, the VM will move on to spawning another isolate with user code and continue executing in the same VM process.

By moving DartDev into an isolate within the same process that user code will eventually run in we're able to resolve the following issues that arose due to signal handling and IPC issues:

VM hangs when --enable-vm-service is supplied and there are compile time errors (https://github.com/dart-lang/sdk/issues/42630)
Dart daemon spinning in exit code handler / zombie Dart processes (https://github.com/dart-lang/sdk/issues/41978)
Signal handling in children of 'dartdev run' is problematic (https://github.com/dart-lang/sdk/issues/41978)

Change-Id: I1c6b1425831b691ad20284716aa80f817dbaf607
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152588
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-07-16 19:03:24 +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
David Morgan 6bd4eefd82 Upgrade package:stream_channel from 2.0.0 (2.0.0 in pubpsec.yaml) to 70433d577be02c48cb16d72d65654f3b4d82c6ed (2.1.0-dev in pubspec.yaml).
R=nbosch@google.com

Change-Id: I3055efd512701d4b0c66862a473da2b425097f55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144725
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-09 09:12:04 +00:00
Ben Konyi 655d3c79a0 [ DDS ] Fix issue where forwarding requests with no RPC parameters would return an error
Another fix for: https://github.com/dart-lang/sdk/issues/41942

Change-Id: I43bd05db968dab92fef81b04fbe13edc0353c502
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149741
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-06-02 19:38:33 +00:00
Ben Konyi 8423423f85 [ package:dds ] Disable strict JSON-RPC protocol checks for clients
Fixes https://github.com/dart-lang/sdk/issues/41942

Change-Id: Ia0c02deaacc38159c731c1549dec1a71ddb4c8ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148781
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-20 18:22:41 +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 2063ce7437 [ package:dds ] Added authentication code support
Also fixed issue where not all VM flags were being forwarded to the child
of an implicit DartDev instance.

Change-Id: I4c7bacb1b93ae336b6ed1f80eb621fbeabd8ced9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148021
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-14 01:32:26 +00:00
Ben Konyi 444490d640 Reland "[ VM / DartDev ] Run all debugging sessions via 'dart run'"
This is a reland of 604a366065

Original change's description:
> [ VM / DartDev ] Run all debugging sessions via 'dart run'
> 
> Prior to this change, running `dart --observe foo.dart` would result in
> the DartDev flow being bypassed. While `dart foo.dart` will continue to
> bypass DartDev and be run directly, running either `dart --observe
> <vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
> will result in the command being implicitly converted to `dart run
> --observe <vm-flags> foo.dart`. This is required for all standalone VM
> instances to run against DDS instead of the VM service directly.
> 
> As usual, the DartDev flow can always be bypassed by providing the
> --disable-dart-dev flag.
> 
> Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

Change-Id: I917d3056322d74766bdf376a3e28871ad5b66cfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147980
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-13 19:58:56 +00:00
David Morgan 964f966c0c Revert "[ VM / DartDev ] Run all debugging sessions via 'dart run'"
This reverts commit 604a366065.

Reason for revert: Breaks google3, see b/156414355

Original change's description:
> [ VM / DartDev ] Run all debugging sessions via 'dart run'
> 
> Prior to this change, running `dart --observe foo.dart` would result in
> the DartDev flow being bypassed. While `dart foo.dart` will continue to
> bypass DartDev and be run directly, running either `dart --observe
> <vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
> will result in the command being implicitly converted to `dart run
> --observe <vm-flags> foo.dart`. This is required for all standalone VM
> instances to run against DDS instead of the VM service directly.
> 
> As usual, the DartDev flow can always be bypassed by providing the
> --disable-dart-dev flag.
> 
> Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I688a3779e7ccaf85a28dc4d6f5ccf23596109519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147900
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-05-13 07:13:35 +00:00
Ben Konyi 604a366065 [ VM / DartDev ] Run all debugging sessions via 'dart run'
Prior to this change, running `dart --observe foo.dart` would result in
the DartDev flow being bypassed. While `dart foo.dart` will continue to
bypass DartDev and be run directly, running either `dart --observe
<vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
will result in the command being implicitly converted to `dart run
--observe <vm-flags> foo.dart`. This is required for all standalone VM
instances to run against DDS instead of the VM service directly.

As usual, the DartDev flow can always be bypassed by providing the
--disable-dart-dev flag.

Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-12 19:53:11 +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 af5f54569c Reland "[ package:dds / Service ] Added support for client naming and resume permissions"
This reverts commit e572bed03e.

Change-Id: I8d8c364e22f7e31c172ea871b2eac3b29fd3577b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145702
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-01 02:09:07 +00:00
Ben Konyi e572bed03e Revert "[ package:dds / Service ] Added support for client naming and resume permissions"
This reverts commit bb959fc0de.

Reason for revert: Failing tests

Original change's description:
> [ package:dds / Service ] Added support for client naming and resume permissions
> 
> Also marked `getClientName`, `setClientName`,
> `requirePermissionToResume` and `ClientName` as deprecated in the VM
> service specification as these features will be moving to DDS and will
> be removed in VM service protocol 4.0.
> 
> Change-Id: I4628ece96349a9883ee9d726d82e5cfae028a826
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144986
> 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: I4e56cd93ad1eeefe69cd632dc798324271274dd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145662
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-30 20:51:46 +00:00
Ben Konyi bb959fc0de [ package:dds / Service ] Added support for client naming and resume permissions
Also marked `getClientName`, `setClientName`,
`requirePermissionToResume` and `ClientName` as deprecated in the VM
service specification as these features will be moving to DDS and will
be removed in VM service protocol 4.0.

Change-Id: I4628ece96349a9883ee9d726d82e5cfae028a826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144986
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-04-30 20:00:22 +00:00
Ben Konyi c97ed9cc11 [ package:dds / Service ] Add support for service extensions to DDS
With this change, DDS takes responsibility for service extension
registration via the service protocol in addition to handling service
extension request routing.

Service extensions registered through dart:developer will continue to
be handled by the VM service as those extensions live within the main
Dart process (this functionality already worked before this CL).

This change also includes a version bump for package:json_rpc_2 to pull
in a bug fix required for this change.

Change-Id: Idb6050058f7695d34276953be159419a5b1b9711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144349
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-04-24 17:13:57 +00:00
Ben Konyi f9816cdc35 [ DDS / Service ] Put the VM service into single client mode when DDS connects
Added a private RPC, _yieldControlToDDS, which DDS invokes once
connected to the VM service. Once this method is called, the following
happens:

- The VM service stops accepting new web socket requests.
- The VM service enters single client mode, where DDS is the single
  client.

DDS can only place the VM service in single client mode when it is the only
VM service client. If other clients are connected, DDS will fail to start and
throw an exception.

The purpose of this change is to simplify state management between the
VM service and DDS. The plan is to delegate the following features to
DDS:

- Service extension management
- Custom client name support
- Isolate resume coordination for multiple clients

Change-Id: I0b3143710d94ee9444a4894e24555f7ed1caf5ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142564
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-04-22 22:03:59 +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 b42c2857f8 [ package:dds ] Fixed smoke_test.dart which was unable to launch smoke.dart due to use of a relative path.
Change-Id: I8dc99b41d00ec571843f576fb25e688f19ebde74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141362
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-03-27 20:17:46 +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