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>
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>
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>
'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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>