orleans icon indicating copy to clipboard operation
orleans copied to clipboard

MessagingTracing OnCreateMessage() causes client initialization to fail when using EventListeners/ETW

Open menozz opened this issue 4 years ago • 1 comments

Hello, guys I've reading the issue: https://github.com/dotnet/orleans/issues/6605 and i've see the fix that solved this problem: https://github.com/dotnet/orleans/pull/6635. But i'm also trying to update Orleans from 3.0.2 to 3.5.1 and i've got the error:

at Orleans.Runtime.ActivationAddress.GetAddress(SiloAddress silo, GrainId grain, ActivationId activation)\r\n at Orleans.Runtime.Message.get_SendingAddress()\r\n at System.Diagnostics.DiagnosticSourceEventSource.TransformSpec.PropertySpec.PropertyFetch.RefTypedFetchProperty2.Fetch(Object obj)\r\n at System.Diagnostics.DiagnosticSourceEventSource.TransformSpec.Morph(Object obj)\r\n at System.Diagnostics.DiagnosticSourceEventSource.FilterAndTransform.Morph(Object args)\r\n at System.Diagnostics.DiagnosticSourceEventSource.FilterAndTransform.<>c__DisplayClass2_1.<.ctor>b__2(KeyValuePair2 evnt)\r\n at System.Diagnostics.DiagnosticListener.Write(String name, Object value)\r\n at Orleans.Runtime.MessagingTrace.OnCreateMessage(Message message)\r\n at Orleans.Runtime.MessageFactory.CreateMessage(InvokeMethodRequest request, InvokeMethodOptions options)\r\n at Orleans.OutsideRuntimeClient.SendRequest(GrainReference target, InvokeMethodRequest request, TaskCompletionSource1 context, InvokeMethodOptions options, String genericArguments)\r\n at Orleans.Runtime.GrainReferenceRuntime.SendRequest(GrainReference reference, InvokeMethodRequest request, InvokeMethodOptions options)\r\n at Orleans.Runtime.GrainReferenceRuntime.InvokeMethod_Impl(GrainReference reference, InvokeMethodRequest request, InvokeMethodOptions options)\r\n at Orleans.Runtime.GrainReferenceRuntime.InvokeMethodAsync[T](GrainReference reference, Int32 methodId, Object[] arguments, InvokeMethodOptions options, SiloAddress silo)\r\n at Orleans.Runtime.GrainReference.InvokeMethodAsync[T](Int32 methodId, Object[] arguments, InvokeMethodOptions options, SiloAddress silo)\r\n at Orleans.Runtime.OrleansCodeGenClusterTypeManagerReference.global::Orleans.Runtime.IClusterTypeManager.GetClusterGrainTypeResolver()\r\n at Orleans.Messaging.ClientMessageCenter.GetGrainTypeResolver(IInternalGrainFactory grainFactory)\r\n at Orleans.OutsideRuntimeClient.<>c__DisplayClass58_0.<<StartInternal>b__1>d.MoveNext()\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at Orleans.OutsideRuntimeClient.<<StartInternal>g__ExecuteWithRetries|58_2>d.MoveNext()\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Orleans.OutsideRuntimeClient.<StartInternal>d__58.MoveNext()\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Orleans.OutsideRuntimeClient.<Start>d__57.MoveNext()\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Orleans.ClusterClient.<Connect>d__20.MoveNext()\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Hydra.Services.Common.Orleans.HydraGrainFactory1.d__7.MoveNext() in

As you can see, exception raised at Orleans.Runtime.Message.get_SendingAddress(), not at Orleans.Runtime.Message.get_TargetAddress().

First version that caused this issue is Orleans. v3.1.0 (without rc suffix). Right behind 3.0.2.

menozz avatar Feb 21 '22 08:02 menozz

I had the same problem recently with an Orleans 3.2.0 application running on dotnet 3.1, because of Rider "Dynamic Program Analysis" (which uses ETW)

The application has worked during years without problems and this issue appeared suddenly. Nothing changed in the application itself but several "external" changes occurred. (Win10->11, minor SDK updates, Rider updates)

In my case, the workaround is to disable Rider DPA.

It also seems that updating to net6 solves the issue.

srollinet avatar May 02 '23 06:05 srollinet