Skip to content

Conversation

@ealsur
Copy link
Member

@ealsur ealsur commented Dec 15, 2023

Once a lease is finished processing, due to split or merge happening or any of the known conditions:

catch (LeaseLostException)
{
closeReason = ChangeFeedObserverCloseReason.LeaseLost;
throw;
}
catch (FeedRangeGoneException)
{
closeReason = ChangeFeedObserverCloseReason.LeaseGone;
throw;
}
catch (CosmosException)
{
closeReason = ChangeFeedObserverCloseReason.CosmosException;
throw;
}
catch (OperationCanceledException) when (shutdownToken.IsCancellationRequested)
{
closeReason = ChangeFeedObserverCloseReason.Shutdown;
}
catch (ChangeFeedProcessorUserException)
{
closeReason = ChangeFeedObserverCloseReason.ObserverError;
throw;
}
catch (Exception) when (processorTask.IsFaulted)
{
closeReason = ChangeFeedObserverCloseReason.Unknown;
throw;
}

The PartitionSupervisor variable is no longer used and goes out of scope to be GCed.

The PartitionSupervisor implements IDisposable but there is no path that explicitly calls Dispose when the supervisor is no longer used.

Closes #4208

@ealsur ealsur added the auto-merge Enables automation to merge PRs label Dec 19, 2023
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

PartitionSupervisorCore.RunAsync leaks System.Threading.CancellationTokenSource+Linked1CancellationTokenSource

6 participants