orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Implicit stream subscription dies on network partition

Open rikbosch opened this issue 9 years ago • 7 comments

Hi,

We're experiencing a problem during a network partition. Some (not all) implicit subscribed grains stop processing new messages.

We're seeing this exception in the log, not sure if it's related..

Trying to send a message Request S10.0.0.4:20015:239358855-> #196448: on a silo not from within grain and not from within system target (RuntimeContext is not set to SchedulingContext) RuntimeContext.Current=null TaskScheduler.Current=Orleans.Runtime.Scheduler.OrleansTaskScheduler

System.InvalidOperationException:
   at Orleans.Runtime.InsideRuntimeClient.SendRequestMessage (OrleansRuntime, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null)
   at Orleans.Runtime.GrainReference.InvokeMethod_Impl (Orleans, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null)
   at Orleans.Runtime.GrainReference.InvokeMethodAsync (Orleans, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null)
   at Orleans.Streams.OrleansCodeGenStreamQueueBalanceListenerReference.QueueDistributionChangeNotification (Orleans, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null)
   at Orleans.Streams.ConsistentRingQueueBalancer.RangeChangeNotification (OrleansRuntime, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null)
   at Orleans.Runtime.ConsistentRing.EquallyDividedRangeRingProvider.RangeChangeNotification (OrleansRuntime, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null)

When we restart the silo with the halted subscription, the queued messages are processed.

We're using orleans 1.5.1 on ServiceFabric and the Azure Queue stream provider

rikbosch avatar Aug 03 '17 14:08 rikbosch

Some (not all) implicit subscribed grains stop processing new messages.

Does this grains still receive messages from their stream, just stop processing them? or they stopped receive messages?

Just to confirm, this 'halted subscription' behavior keep happening after the network partition is restored?

xiazen avatar Aug 04 '17 00:08 xiazen

I can't say for sure. The grain is not processing any messages, but resumes processing queued messages in the stream after restarting the faulty silo.

rikbosch avatar Aug 04 '17 20:08 rikbosch

During the network partition, it's possible that consumer grains stop processing messages because pulling agent and some consumer grains are in different silos, hence messaging between the two parties are interrupted by network partition, which caused pulling agent failed delivering messages to some consumers. This will create the impression of consumer stopped processing messages. But the actual fact maybe consumer stopped receiving messages. Does this guess match what you have seen?

To verify this guess, try look at PersistentStreamPullingAgent logs and see if there's any exception related to message delivery.

Does this keep happening after you fixed the network partition?

xiazen avatar Aug 07 '17 19:08 xiazen

Looks as if it's the same issue that https://github.com/dotnet/orleans/pull/3256 is trying to address.

sergeybykov avatar Aug 09 '17 16:08 sergeybykov

@xiazen what you describe seems to be happening, after fixing the partition the processing is resumed.

rikbosch avatar Aug 10 '17 09:08 rikbosch

@rikbosch Can we close this then?

sergeybykov avatar Aug 16 '17 16:08 sergeybykov

🖒

rikbosch avatar Aug 17 '17 19:08 rikbosch