Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: runtime/vm/service/running_isolates.dart

Issue 1347693004: getIsolate rpc now returns collected sentinel for expired isolate. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/tests/service/get_isolate_rpc_test.dart ('k') | runtime/vm/service/service.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/running_isolates.dart
diff --git a/runtime/vm/service/running_isolates.dart b/runtime/vm/service/running_isolates.dart
index 48ac1f52dda621a6769f1718bc2dca80c4a9a645..b10128c3b1d8791f040bc904fc39412c423d5191 100644
--- a/runtime/vm/service/running_isolates.dart
+++ b/runtime/vm/service/running_isolates.dart
@@ -47,8 +47,14 @@ class RunningIsolates implements MessageRouter {
}
var isolate = isolates[isolateId];
if (isolate == null) {
- message.setErrorResponse(
- kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
+ // There is some chance that this isolate may have lived before,
+ // so return a sentinel rather than an error.
+ var result = {
+ 'type' : 'Sentinel',
+ 'kind' : 'Collected',
+ 'valueAsString' : '<collected>',
+ };
+ message.setResponse(encodeResult(message, result));
return message.response;
}
return isolate.route(message);
« no previous file with comments | « runtime/observatory/tests/service/get_isolate_rpc_test.dart ('k') | runtime/vm/service/service.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698