2016-10-27 5 views
1

1.3.0にアップグレードしただけで、一般的なグレインに問題があります。ジェネリックorleansグレインを使用するときに「キーが辞書に存在しませんでした」

この問題を示しています例のインターフェースとクラス:

public interface IGenericTest<T> : IGrainWithIntegerKey 
{ 
    Task<T> PrintType(T obj); 
} 



public class GenericTestGrain<T> : Grain, IGenericTest<T> 
{ 
    public Task<T> Print(T obj) 
    { 
     Debug.WriteLine("TEST"); 
     return Task.FromResult(obj); 
    } 
} 

を、それが好きで使用して:

var grain = await GrainFactory.GetGrain<IGenericTest<int>>(0); // Runs without error. 
await grain.Print(1); 

粒が細かいのようです取得が、私は穀物のメソッドを呼び出します私は得る:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. 

at System.Collections.Generic.Dictionary`2.get_Item(TKey key) 
at Orleans.InterceptedMethodInvokerCache.GetInterfaceToImplementationMap(Int32 interfaceId, Type implementationType) 
at Orleans.InterceptedMethodInvokerCache.CreateInterceptedMethodInvoker(Type implementationType, Int32 interfaceId, IGrainMethodInvoker invoker) 
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) 
at Orleans.InterceptedMethodInvokerCache.GetOrCreate(Type implementationType, Int32 interfaceId, IGrainMethodInvoker invoker) 
at Orleans.Runtime.InsideRuntimeClient.InvokeWithInterceptors(IAddressable target, InvokeMethodRequest request, IGrainMethodInvoker invoker) 
at Orleans.Runtime.InsideRuntimeClient.<Invoke>d__57.MoveNext() 

私は行方不明がありますか?たぶん新しい設定ですか?これは私が使っていた以前のバージョンとうまくいった。

EDIT:

providerRuntime.SetInvokeInterceptor((メソッド、要求、穀物、インボーカ)=> { リターンinvoker.Invoke(穀物、要求:それは呼出しインターセプターの問題だよう

らしいです); });

これを削除するとすべてが機能します。

+0

Orleansのバグであるようです:https://github.com/dotnet/orleans/issues/2358 –

答えて

関連する問題