Skip to content

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 force-pushed the fix/activationdata-lifecycle branch from 24d2e0c to deb9725 Compare August 15, 2024 15:41
@ReubenBond ReubenBond force-pushed the fix/activationdata-lifecycle branch from deb9725 to 3df01ae Compare August 17, 2024 16:34
@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
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2024
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.

1 participant