I have an integration test that fails roughly 1 in 5 times. It fails because the subscription gets dropped. Here is the log:
[27,15:38:48.172,DEBUG] Catch-up Subscription to $ce-Foo: starting…
[27,15:38:48.173,DEBUG] Catch-up Subscription to $ce-Bar: starting…
[28,15:38:48.177,DEBUG] Catch-up Subscription to $ce-Foo: running…
[32,15:38:48.177,DEBUG] Catch-up Subscription to $ce-Bar: running…
[32,15:38:48.178,DEBUG] Catch-up Subscription to $ce-Bar: pulling events…
[28,15:38:48.177,DEBUG] Catch-up Subscription to $ce-Foo: pulling events…
[32,15:38:48.229,DEBUG] Catch-up Subscription to $ce-Bar: finished reading events, nextReadEventNumber = 0.
[28,15:38:48.229,DEBUG] Catch-up Subscription to $ce-Foo: finished reading events, nextReadEventNumber = 0.
[28,15:38:48.229,DEBUG] Catch-up Subscription to $ce-Foo: subscribing…
[32,15:38:48.229,DEBUG] Catch-up Subscription to $ce-Bar: subscribing…
[32,15:38:48.236,DEBUG] Catch-up Subscription to $ce-Bar: dropping subscription, reason: CatchUpError System.NullReferenceException: Object reference not set to an instance of an object.
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary
2.Add(TKey key, TValue value)
at EventStore.ClientAPI.Embedded.EmbeddedSubcriptionsManager.StartSubscription(Guid correlationId, IEmbeddedSubscription subscription)
at EventStore.ClientAPI.Embedded.EmbeddedSubscriber.StartSubscription(Guid correlationId, TaskCompletionSource1 source, String stream, UserCredentials userCredentials, Boolean resolveLinkTos, Action
2 eventAppeared, Action3 subscriptionDropped) at EventStore.ClientAPI.Embedded.EventStoreEmbeddedNodeConnection.SubscribeToStreamAsync(String stream, Boolean resolveLinkTos, Action
2 eventAppeared, Action`3 subscriptionDropped, UserCredentials userCredentials)
at EventStore.ClientAPI.EventStoreCatchUpSubscription.b__0(Object _).
``
I’ve tried adding a subscriptionDropped delegate to re-subscribe, but this doesn’t appear to fire.
Any ideas?