Subscription threading

So is there a default max number of threads that the eventstore client will use on subscriptions? I just replayed my store and the mongo driver that I’m using with my denormalizer is crashing because it’s running out of threads in the pool. I’d like to align them.

there is on a catchup subsccritpion. 1.

it is in fact async as well..

as in they’re tasks/promises that are being started?

Ok i’ll just drop in a semaphore then

So I put the semaphore in, to try an align it with the connection pool size and everything seemed to be going well but then I noticed that not all events were making it into my mongo database. I’m not seeing any errors on the mongo side as I have put lots of logging in to try and detect a failure. At the moment, I’m missing upwards of 15k records. I’ve been scratching my head trying to find them. When I tally up the events in EventStore, it shows 519k events but mongo only shows 504k. I encounter this when trying to replay the event store which makes me think the denormalizer is being overloaded.

The only thing I can think of is that the tasks being fired off by EventStore (EventAppeared) are backing up whilst waiting for the mongodb C# driver to release a connection so that the next event can be processed. Could it be that the Tasks are timing out while waiting for the next connection???

Is this something that should have been handled using CatchupSubscriptionSettings by setting the queue and read batch sizes?? I just noticed this was in here