6f704e0e97
Once the vm-service isolate starts up it will iterate over all isolates to discover already started isolates. It does so via iterating over all isolate groups and all isolates within them. Doing so requires a read lock. Until now it has called into Dart while holding the read lock. This can lead to a deadlock, since calling Dart code can trigger JIT compilation which can trigger various things that require the same lock. Instead, this CL accumulates a list of (isolate-main-port, isolate-name) pairs while iterating over isolate groups and the isolates therein. Afterwards it registers those isolates in a bulk - without holding any locks. Issue https://github.com/dart-lang/sdk/issues/36097 TEST=Refactoring of existing test suite. Fixes flaky timeouts. Change-Id: Iea7013ce57cef2500700fb464972104c66357777 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182321 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>