Skip to content

Commit

Permalink
Don't block traffic to old instances too early during search isolate …
Browse files Browse the repository at this point in the history
…renewal. (#7045)
  • Loading branch information
isoos authored Sep 18, 2023
1 parent 273e38c commit 33bf5b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Important changes to data models, configuration, and migrations between each
AppEngine version, listed here to ease deployment and troubleshooting.

## Next Release (replace with git tag when deployed)
* Fix: search isolate renewal doesn't block ongoing traffic.

## `20230914t133300-all`
* Bumped runtimeVersion to `2023.09.12`.
Expand Down
5 changes: 4 additions & 1 deletion app/lib/service/entrypoint/_isolate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ class IsolateRunner {
required Duration wait,
}) async {
final isolatesToClose = [..._isolates];

await start(count);
// prevent traffic to hit the old instances
for (final i in isolatesToClose) {
i.markedForRenew = true;
}
await start(count);

await Future.delayed(wait);
for (final i in isolatesToClose) {
await i.close();
Expand Down
3 changes: 3 additions & 0 deletions app/lib/service/entrypoint/_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,7 @@ class IsolateRequestException implements Exception {
final String message;

IsolateRequestException(this.message);

@override
String toString() => 'IsolateRequestException: $message';
}

0 comments on commit 33bf5b6

Please sign in to comment.