Repository navigation
Add coverage for generic state parameter using Azure Storage (after #1897) - #1915
Conversation
|
There is still a problem with TableStorage on generic grains. But I'd expect not only ClearState to fail, but ReadState and WriteState as well. The problem is that the grainType contains the generic parameters as fully qualified types (including assembly info) instead of just the base type names. The Table Storage Provider then does grainReference.ToKeyString(), which creates a string that, in the case of a generic grain, adds the complete generictype in the key string, creating a partitionkey that is too long; TableStorage does not accept it. Simplest solution would be to change the ToKeyString() function to return a more compact string for generic grain. A better solution would be to fix the whole internal handling of generic grain type names to not use type.FullName anymore, but type.ToString() or TypeUtils.GetParseableName() |
|
I am debugging this; I'm completely at loss why ClearState behaves differently from ReadState and WriteState. It seems the culprit is somewhere in the rowkey value: Azure Table Storage does not like the value in it (which is the grainType), but only in Replace and Delete table operations. Insert and Read seem to work fine with the same values! Sanitizing the row key with Simplest solution would be to do away with the rowkey completely as it's not helping anyway, but for backwards compatibility it's probably wiser to keep the grainType in there for non-generic grains and make it empty for generic grains (breaking generic state partition key will happen anyway now, so we can break the rowkey too) |
|
@Maarten88, @jdom Just in case, I note here that relational storage provider needs a enough data in |
|
I found some recent documentation on differences between Azure Storage and Storage Emulator that might help here: https://docs.microsoft.com/en-gb/azure/storage/storage-use-emulator specifically:
|
By doing this, I encountered that this is still failing on the call to ClearState
49bbb08 to
1582af0
Compare
|
Rebased this (since there were many conflicts) and added a way to skip the tests if they are being run from the emulator, given the differences in combined property lengths supported in comparison with the production service. |
|
This ought to have been fixed by #2715. I'll take a look and merge |
|
Could be, not sure, I did not run it again before rebase, but after the rebase I was still seeing the same stack trace on |
|
Ok, so it seems that blob names can be at most 261 characters when using the Azure Storage Emulator. If I truncate the name to 260 chars, then I get a 404 instead of a 400. |
While I was doing this minor cleanup, I encountered that this is still failing on the call to ClearState.
@Maarten88 do you know if this is still related to the grain type name or is this a new bug?
Both tests (with long and short name) are now failing, these are the details: