orleans icon indicating copy to clipboard operation
orleans copied to clipboard

NullRef exception in IAsyncStream<T>.SubscribeAsync(observer) when upgrading to 1.4.0

Open lucasgodshalk opened this issue 9 years ago • 4 comments

Here's a sanitized version of the code where the error occurs:

var provider = GrainClient.GetStreamProvider("SMSProvider");
var observer = new MyObserver(id);
var stream = provider.GetStream<VisualPacket>(id, "namespace");
observer._handle = await stream.SubscribeAsync(observer);

I upgraded from 1.4.0 from 1.3.1 and SubscribeAsync() is throwing a null ref exception. This code was working fine before the upgrade, and I haven't made any other modifications to my code/configuration. My only configuration for streams is registering the provider and backing store:

client:

config.RegisterStreamProvider<SimpleMessageStreamProvider>("SMSProvider");

silo:

config.AddMemoryStorageProvider("PubSubStore");
config.AddSimpleMessageStreamProvider("SMSProvider", fireAndForgetDelivery: true);

Here's the stack trace:

   at Orleans.Providers.ClientProviderRuntime.ExecutingEntityIdentity()
   at Orleans.Streams.StreamConsumerExtension.SetObserver[T]()
   at Orleans.Streams.StreamConsumer1.<SubscribeAsync>d__14.MoveNext()

I'm going to ping @ReubenBond on this, because it looks like most of the recent runtime client work was his.

lucasgodshalk avatar Feb 22 '17 14:02 lucasgodshalk

We had a similar problem just the other day. We figured out that it is the Client Configuration logging level. Changed it from <Tracing DefaultTraceLevel="Verbose" ...> to anything higher ("Info" or "Warning") seems to have fixed it.

Specifically its the logging for "Provider" that is killing us: <TraceLevelOverride LogPrefix="Provider" TraceLevel="**## Verbose**" /> is bad

jeoffman avatar Mar 03 '17 18:03 jeoffman

@TrexinanF14 The call stack above seems incomplete to me. Are you sure there weren't more frames on it? Have you solved this by turning off verbose logging?

sergeybykov avatar Apr 04 '17 20:04 sergeybykov

By setting the TraceLevel to verbose or higher, I was able to reproduce this in 1.4 and .1.4.1, but not in the current code, so it should be fixed in 1.5 release.

jason-bragg avatar Apr 04 '17 20:04 jason-bragg

Fixed in master, likely as part of the removal of statics. The fix will be included in 1.5.0.

sergeybykov avatar Apr 05 '17 16:04 sergeybykov