[vm/isolate_api] Ensure isolate acquisition fails gracefully when target isolate is exiting.
Introduce `is_acquirable` isolate property that tracks whether isolate can be entered, avoid a `pool_` check that does not work correctly as isolate being shutdown. BUG=https://github.com/dart-lang/sdk/issues/63515 BUG=https://github.com/dart-lang/sdk/issues/63514 TEST=ci Change-Id: I84577ad082d87ead8cdb9f591fabdf918e2f4bd0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509221 Reviewed-by: Slava Egorov <vegorov@google.com>
This commit is contained in:
@@ -118,7 +118,10 @@ Future<void> testFailToRunOnExitedIsolate() async {
|
||||
() => child.runSync(() {
|
||||
print('child runSync is running');
|
||||
}),
|
||||
(e) => e is StateError && e.message.contains("Unable to enter the isolate"),
|
||||
(e) =>
|
||||
e is StateError &&
|
||||
(e.message.contains("Unable to enter the isolate") ||
|
||||
e.message.contains("Isolate has a message loop running")),
|
||||
);
|
||||
rp.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user