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

Try to limit forwarding when a grain activation throws an exception in OnActivateAsync() #6891

Merged
merged 5 commits into from
Jan 15, 2021

Conversation

benjaminpetit
Copy link
Member

@benjaminpetit benjaminpetit commented Jan 13, 2021

The goal of this PR is to reduce the occurrence of forwarding failure because a grain cannot be activated due to a failure in OnActivateAsync().

When a grain has no activation, it's possible that multiple silos will try to create multiple activations for the same grain identity at the same time. But only one activation will win the race, and all other silos will then forward the requests to the winning activation.

If this winning activation throws during OnActivateAsync(), it might trigger another potential race for activation creation, and additional forwarding. As a result, the user might see several "Forwarding failed" exceptions instead of the exception that was thrown during the activation process.

/// <summary>
/// Remove all expired value from the LRU instance.
/// </summary>
public void RemoveExpired()
Copy link
Member

Choose a reason for hiding this comment

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

Is this only called from test code?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I forgot a commit :) I just call it when we delete idle activations

@ReubenBond
Copy link
Member

Looks like there are some tests which need fixing (wrong exception type), which is a good sign :)

@benjaminpetit
Copy link
Member Author

/azp run Azure DevOps - Functional

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ReubenBond ReubenBond merged commit 1a82b94 into dotnet:master Jan 15, 2021
benjaminpetit added a commit to benjaminpetit/orleans that referenced this pull request Jan 15, 2021
ReubenBond pushed a commit that referenced this pull request Jan 16, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants