dotnet / dotnet/orleans

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

Open
#8,200 29 comments 0 reactions 1 assignee View on GitHub

@ReubenBond is already working on this.

Since Nov 30, 2022.

Needs: triage :mag:
Dominant language
C#
Stars
10.9k
Forks
2.1k
Avg merge
13h 56m
Merged PRs (30d)
351

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.