Skip to content

Finalizers behavior on Exception #226

Answered by erin-allison
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

I don't have anything set up right now to properly test this, but from digging through the code, I am relatively confident that the event will be re-queued and your finalizer will be called again.

Based on the logic in FinalizerManager<TEntity>, we can see that if any of your registered IResourceFinalizer<TEntity> instances throw an exception, they will not be removed from the resource, continuing to block deletion.

try
{
await semaphore.WaitAsync();
entity.RemoveFinalizer(finalizer.Identifier);
}
finally
{
semaphore.Release();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@buehler
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants