From 8ea0ec786adafa70daab7eda104adedcc150f323 Mon Sep 17 00:00:00 2001 From: Reuben Bond <203839+ReubenBond@users.noreply.github.com> Date: Sat, 11 Nov 2023 11:48:43 -0800 Subject: [PATCH] Do not retry membership updates during shutdown with dev clustering (#8719) --- .../MembershipService/MembershipTableManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Orleans.Runtime/MembershipService/MembershipTableManager.cs b/src/Orleans.Runtime/MembershipService/MembershipTableManager.cs index 52deaf0556..8d3f55986f 100644 --- a/src/Orleans.Runtime/MembershipService/MembershipTableManager.cs +++ b/src/Orleans.Runtime/MembershipService/MembershipTableManager.cs @@ -316,18 +316,18 @@ public async Task UpdateStatus(SiloStatus status) try { - async Task updateMyStatusTask(int counter) + async Task UpdateMyStatusTask(int counter) { numCalls++; if (log.IsEnabled(LogLevel.Debug)) log.LogDebug("Going to try to TryUpdateMyStatusGlobalOnce #{Attempt}", counter); return await TryUpdateMyStatusGlobalOnce(status); // function to retry } - if (status == SiloStatus.Dead && this.membershipTableProvider is SystemTargetBasedMembershipTable) + if (status.IsTerminating() && this.membershipTableProvider is SystemTargetBasedMembershipTable) { // SystemTarget-based membership may not be accessible at this stage, so allow for one quick attempt to update // the status before continuing regardless of the outcome. - var updateTask = updateMyStatusTask(0); + var updateTask = UpdateMyStatusTask(0); updateTask.Ignore(); await Task.WhenAny(Task.Delay(TimeSpan.FromMilliseconds(500)), updateTask); @@ -339,7 +339,7 @@ async Task updateMyStatusTask(int counter) return; } - bool ok = await MembershipExecuteWithRetries(updateMyStatusTask, this.clusterMembershipOptions.MaxJoinAttemptTime); + bool ok = await MembershipExecuteWithRetries(UpdateMyStatusTask, this.clusterMembershipOptions.MaxJoinAttemptTime); if (ok) {