[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:
Alexander Aprelev
2026-06-10 09:59:06 -07:00
parent 24cf34371a
commit 8f1a38f07b
8 changed files with 22 additions and 37 deletions
+4 -1
View File
@@ -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();
}