StateStorageBridge ClearStateAsync does not reset the State property anymore
Hello,
we've upgraded from 8.1 to 8.2.1 and found out following change in behavior caused by PR #9417.
ClearStateAsync from StateStorageBridge class does not reset the state to default value anymore. It is not clear to me whether this is wanted, according to the description in mentioned PR.
IGrainState<T>.State should never be null after returning from an IGrainStorage method without an exception being thrown. That means it should be set to a new instance of T in ReadStateAsync() and ClearStateAsync() before returning if it would otherwise have been null.
Is this a bug or wanted behavior?
In any case, the current behavior is not consistent with MemoryStorage, where the state is still set to default value _activatorProvider.GetActivator<T>().Create().
Thank you Tomas
Hi, any comments on this?
Hi @tomhreb, when you say ClearStateAsync does not set the state to default, what does it do. Does it leave the state unchanged?
Hi @ReubenBond yes - exactly. Stays unchanged, which was changed here: https://github.com/dotnet/orleans/pull/9417/files#diff-65b32be6328ceb2cfe9eb987c313bc3cd7eb2424b65c6aed1e0deb65036f1100L127