Skip to content

Commit

Permalink
Do not retry membership updates during shutdown with dev clustering (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenBond authored Nov 11, 2023
1 parent 6584ba9 commit 8ea0ec7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,18 @@ public async Task UpdateStatus(SiloStatus status)

try
{
async Task<bool> updateMyStatusTask(int counter)
async Task<bool> 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);

Expand All @@ -339,7 +339,7 @@ async Task<bool> updateMyStatusTask(int counter)
return;
}

bool ok = await MembershipExecuteWithRetries(updateMyStatusTask, this.clusterMembershipOptions.MaxJoinAttemptTime);
bool ok = await MembershipExecuteWithRetries(UpdateMyStatusTask, this.clusterMembershipOptions.MaxJoinAttemptTime);

if (ok)
{
Expand Down

0 comments on commit 8ea0ec7

Please sign in to comment.