orleans: TypeLoadException: Unable to resolve type alias "("inv",[Orleans.Runtime.GrainReference]

Hey guys, is there some reason I can’t use same method name again?

For example, Let’s say I have following grain

public interface ISomeGrain : IGrainWithIntegerKey
{
    Task Method();
}

and I’ve accidentally getting TypeLoadException: Unable to resolve type alias "("inv",[Orleans.Runtime.GrainReference] exception by changing signature like:

public interface ISomeGrain : IGrainWithIntegerKey
{
    Task Method(int accidentParameter);
}

so I hot-fixed the grain by adding a new signature like:

[Version(1)]
public interface ISomeGrain : IGrainWithIntegerKey
{
    Task Method();
    Task NewMethod(int accidentParameter);
}

and everything went okay. (this was a painful experience tho…)

The problem is I cannot use the same method name again and wonder why is that so. I’ve completely deployed version 1 grain and trying to reclaim the method name back but Orleans kept throwing TypeLoadException again like interface below:

[Version(2)]
public interface ISomeGrain : IGrainWithIntegerKey
{
    Task Method(int accidentParameter);
}

Here’s my question:

  1. Why am I not allowed to use the method name of the previous version?
  2. Why am I not allowed to accept consequences (having side effects, being not backward compatible) but getting runtime errors instead of making silent signature changes?

I have a staging environment of 12 different hetero silos (because of microservices…) and only 2 of them got interface signature changes deployed. The one is the silo where grain got implemented and the one is the silo where we have the client (via GrainFactory) and the client is throwing TypeLoadException even if I have deployed version 2 of the grain interface on both silos.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 29 (11 by maintainers)

Most upvoted comments

Thank you for confirming, @sc-starman

migration from 7.2.3 to 8.0.0-rc2 I got the same exception:

 Exception reading message Request [ sys.client/adf9fef2141c4881b1d4b8d5970cb3cb]->[S10.0.8.184:30000:0 sys.svc.manifest/10.0.8.184:30000@0] #302529 from remote endpoint 10.0.8.222:35278 to local endpoint 10.0.8.184:30000
System.TypeLoadException: Unable to resolve type alias "("inv",[Orleans.Runtime.GrainReference],[Orleans.Runtime.IClusterManifestSystemTarget,Orleans.Core],"4EFCA109")".
   at Orleans.Serialization.TypeSystem.TypeConverter.ResolveCompoundAliasType[TState](TupleTypeSpec input, TState& state) in /_/src/Orleans.Serialization/TypeSystem/TypeConverter.cs:line 545
   at Orleans.Serialization.TypeSystem.RuntimeTypeNameRewriter.TypeRewriter`1.HandleCompoundType(TupleTypeSpec type, String assemblyName) in /_/src/Orleans.Serialization/TypeSystem/RuntimeTypeNameRewriter.cs:line 223
   at Orleans.Serialization.TypeSystem.RuntimeTypeNameRewriter.TypeRewriter`1.ApplyInner(TypeSpec input, String assemblyName) in /_/src/Orleans.Serialization/TypeSystem/RuntimeTypeNameRewriter.cs:line 77
   at Orleans.Serialization.TypeSystem.TypeConverter.ParseInternal(TypeSpec parsed, Type& type) in /_/src/Orleans.Serialization/TypeSystem/TypeConverter.cs:line 345
   at Orleans.Serialization.TypeSystem.TypeCodec.TryRead[TInput](Reader`1& reader) in /_/src/Orleans.Serialization/TypeSystem/TypeCodec.cs:line 72
   at Orleans.Serialization.Codecs.FieldHeaderCodec.ReadType[TInput](Reader`1& reader, SchemaType schemaType) in /_/src/Orleans.Serialization/Codecs/FieldHeaderCodec.cs:line 187
   at Orleans.Serialization.Codecs.FieldHeaderCodec.ReadExtendedFieldHeader[TInput](Reader`1& reader, Field& field) in /_/src/Orleans.Serialization/Codecs/FieldHeaderCodec.cs:line 169
   at Orleans.Runtime.Messaging.MessageSerializer.ReadBodyObject[TInput](Message message, Reader`1& reader) in /_/src/Orleans.Core/Messaging/MessageSerializer.cs:line 130
   at Orleans.Runtime.Messaging.MessageSerializer.TryRead(ReadOnlySequence`1& input, Message& message) in /_/src/Orleans.Core/Messaging/MessageSerializer.cs:line 126
   at Orleans.Runtime.Messaging.Connection.ProcessIncoming() in /_/src/Orleans.Core/Networking/Connection.cs:line 349

It was my mistake that I didn’t update the client to 8.0.0-rc2, after update everything seems to be fine again.

@ReubenBond we just saw this error today while doing a rolling upgrade from Orleans 8 to Orleans 9.

8.0.0 or a later version, and did you change anything else during the upgrade?

thanks for the quick reply, the upgrade was from 8.2.0 to 9.0.1, but I just realized I updated an existing interface which was the actual reason of the errors.

@prfi01 there was a break in wire compatibility (my mistake, it was required to fix a rare bug). This won’t be an issue for messages stored in streams, but it prevents some messages from being compatible between 7.x hosts and 8.x hosts. If you shutdown the 7.x cluster and deploy an 8.x cluster it won’t be an issue.

Please accept my apologies for the trouble caused

@turowicz it could be due to that. I’ll see if it can be updated