Skip to content

Enable to activate Grain after clearing its state - #9165

Merged
benjaminpetit merged 3 commits into
dotnet:mainfrom
scalalang2:enable-to-activate-after-clearing-its-state
Nov 12, 2024
Merged

benjaminpetit merged 3 commits into
dotnet:mainfrom
scalalang2:enable-to-activate-after-clearing-its-state

Conversation

@scalalang2

@scalalang2 scalalang2 commented Oct 8, 2024 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

@benjaminpetit PTAL

@benjaminpetit
benjaminpetit merged commit 90fd1d0 into dotnet:main Nov 12, 2024
@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