One of our systems built on top of OpenRasta is falling over with what looks like a race condition. We are using Castle Windsor 2.1 for IoC, which is also plugged into OpenRasta. The exceptions (stack trace below) only occur when our web application starts up under load.
OpenRasta registers some components, with Windsor, on-demand, i.e. when a component is resolved, if it hasn't been registered already, it is registered and then resolved. If many requests are served at the same time, this on-demand registering of components causes exceptions to be thrown within Windsor. My question is, are the methods within IWindsorContainer(WindsorContainer) for registering components meant to be thread-safe, or should OpenRasta be written to counter for this lack of thread-safety when registering components? ---- System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: capacity at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument) at System.Collections.Generic.Dictionary`2..ctor(Int32 capacity, IEqualityComparer`1 comparer) at System.Collections.Generic.Dictionary`2..ctor(IDictionary`2 dictionary, IEqualityComparer`1 comparer) at System.Collections.Generic.Dictionary`2..ctor(IDictionary`2 dictionary) at Castle.MicroKernel.Handlers.AbstractHandler.DependencySatisfied(Boolean& stateChanged) at Castle.MicroKernel.DefaultKernel.DoActualRaisingOfHandlersChanged() at Castle.MicroKernel.DefaultKernel.RaiseHandlersChanged() at Castle.MicroKernel.DefaultKernel.RegisterHandler(String key, IHandler handler, Boolean skipRegistration) at Castle.MicroKernel.DefaultKernel.RegisterHandler(String key, IHandler handler) at Castle.MicroKernel.DefaultKernel.AddComponent(String key, Type serviceType, Type classType, LifestyleType lifestyle, Boolean overwriteLifestyle) at Castle.Windsor.WindsorContainer.AddComponentLifeStyle(String key, Type serviceType, Type classType, LifestyleType lifestyle) at OpenRasta.DI.Windsor.WindsorDependencyResolver.AddDependencyCore(Type dependent, Type concrete, DependencyLifetime lifetime) at OpenRasta.DI.Windsor.WindsorDependencyResolver.AddDependencyCore(Type handlerType, DependencyLifetime lifetime) at OpenRasta.DI.DependencyResolverCore.AddDependency(Type concreteType, DependencyLifetime lifetime) at OpenRasta.DI.DependencyManager.GetService(Type dependencyType) at OpenRasta.Pipeline.Contributors.ResponseEntityWriterContributor.WriteResponse(ICommunicationContext context) at OpenRasta.Pipeline.PipelineRunner.ExecuteContributor(ICommunicationContext context, ContributorCall call) ---- -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
