Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not retry membership updates during shutdown with dev clustering #8719

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading