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

Enable to activate Grain after clearing its state #9165

Conversation

scalalang2
Copy link
Contributor

@scalalang2 scalalang2 commented Oct 8, 2024

resolve #9154

Background

The ClearStateAsync funcction doesn't remove the entry from storage by default.
Instead it only sets the state value to null,

If ReadStateAsync() is invoked when the value is null,
then it occurs an error from Serializer. Insufficient data present in buffer.

This error happens during the process of restarting our cluster.

  1. The default value of DeleteStateOnClear is false.
  2. The PubSubRendezvousGrain activates upon stream registration.
  3. It calls ClearStateAsync() if there are no producers.
  4. the grain reactivates after being deactivated, ReadStateAsync() is invoked
  5. This leads to an error -> Insufficient data present in buffer.
Microsoft Reviewers: Open in CodeFlow

@ReubenBond
Copy link
Member

@benjaminpetit PTAL

@benjaminpetit benjaminpetit merged commit 90fd1d0 into dotnet:main Nov 12, 2024
22 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 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.

Cannot activate the grain after clearing its state.
3 participants