-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cannot activate the grain after clearing its state. #9154
Comments
I had also investigated the AzureTableStorage code Even if this is an intentional behavior |
My Suggestion.T dataValue = default;
try
{
if(entity.State.Length > 0)
dataValue = this.options.GrainStorageSerializer.Deserialize<T>(entity.State);
}
catch (Exception exc)
{
// handle errors.
} |
@ReubenBond If you agree with the solution described above comment, I'll take this job. |
@scalalang2 looks good to me, but we should make the if condition also check for
How does that sound? |
@ReubenBond Thanks for reply, DynamoDBGrainStorage.ReadStateAsyncif (record != null)
{
var loadedState = ConvertFromStorageFormat<T>(record);
grainState.RecordExists = loadedState != null;
grainState.State = loadedState ?? Activator.CreateInstance<T>();
grainState.ETag = record.ETag.ToString();
}
else
{
grainState.State = _activatorProvider.GetActivator<T>().Create()
} DynamoDBGrainStorage.ClearStateAsyncif (this.options.DeleteStateOnClear)
{
// codes
}
else
{
// codes
}
grainState.State = _activatorProvider.GetActivator<T>().Create() Additionally, I'd like to put the issue I've noticed with Streaming Functioanlity. |
Environment
Persistent Storage Provider
: DynamoDBFramework Version
: Orleans 8.2.0Background
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 isnull,
then it occurs an error from Serializer. :
Insufficient data present in buffer.
ReadStateAsync
is called when trying to activate the same grainClearStateAsync
How to reproduce
Logs
The text was updated successfully, but these errors were encountered: