Skip to content

Commit

Permalink
Try to deflake service isolate startup (flutter#35950)
Browse files Browse the repository at this point in the history
dnfield authored Sep 6, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent cd38c53 commit 28999a1
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions runtime/dart_service_isolate.cc
Original file line number Diff line number Diff line change
@@ -157,18 +157,6 @@ bool DartServiceIsolate::Startup(std::string server_ip,
result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol);
SHUTDOWN_ON_ERROR(result);

// Make runnable.
Dart_ExitScope();
Dart_ExitIsolate();
*error = Dart_IsolateMakeRunnable(isolate);
if (*error) {
Dart_EnterIsolate(isolate);
Dart_ShutdownIsolate();
return false;
}
Dart_EnterIsolate(isolate);
Dart_EnterScope();

library = Dart_RootLibrary();
SHUTDOWN_ON_ERROR(library);

@@ -202,6 +190,19 @@ bool DartServiceIsolate::Startup(std::string server_ip,
library, Dart_NewStringFromCString("_enableServicePortFallback"),
Dart_NewBoolean(enable_service_port_fallback));
SHUTDOWN_ON_ERROR(result);

// Make runnable.
Dart_ExitScope();
Dart_ExitIsolate();
*error = Dart_IsolateMakeRunnable(isolate);
if (*error) {
Dart_EnterIsolate(isolate);
Dart_ShutdownIsolate();
return false;
}
Dart_EnterIsolate(isolate);
Dart_EnterScope();

return true;
}

0 comments on commit 28999a1

Please sign in to comment.