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

Allow deactivation to be triggered during activation, clean up deactivation flow #9116

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

ReubenBond
Copy link
Member

@ReubenBond ReubenBond commented Aug 15, 2024

This PR cleans up activation lifecycle around shutdown, removing some duplication and improving hygiene around cancellation.

It enables deactivation to be triggered while a grain is still activating, eliminating the "Calling DeactivateOnIdle from within OnActivateAsync is not supported" message. When deactivation is triggered, the CancellationToken passed to the ongoing OnActivateAsync will be canceled.

This PR also fixes a possible NullReferenceException when a silo is shutting down ungracefully and a grain is disposed without first being deactivated, which can happen during ungraceful shutdown.

Microsoft Reviewers: Open in CodeFlow

@ReubenBond ReubenBond changed the title Improve grain activation shutdown, allow activating grains to be deactivated Allow deactivation to be triggered during activation, clean up deactivation flow Aug 15, 2024
@ReubenBond ReubenBond merged commit 7291dd4 into dotnet:main Aug 20, 2024
22 checks passed
@ReubenBond ReubenBond deleted the fix/activationdata-lifecycle branch August 20, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant