lamronby/wcfextrasplus

Concurrent access to cache dictionary while loading Xml Comments

Closed this issue · 9 comments

Hello,
We are facing following issue:
image
From this post: https://stackoverflow.com/questions/1320264/how-did-i-get-this-nullreferenceexception-error-here-right-after-the-constructor I concluded that it is issue with concurrent access to dictionary.
After the restart of application on IIS it is no longer present, but it was repeated several times and we don't know what is causing it.

In your docs I read that Xml comments are generated only on build of application. My app is hosted on IIS.
Am I missing something? If Xml comments are generated on build, how can the concurrency issue emerge?
I can't reproduce the issue because I am not sure when this particular function is invoked.

Maybe you could you give me some hints, how it occured?
We thought about recompilling your library with ConcurrentDictionary as a replacement, but maybe the issue is on our side, so we would like to investigate possible causes.

We recompilled your library with ConcurrentDictionary as a replacement and it resolved the issue.
Therefore I am closing it.

I'm very curious how this occurs. Are you using non-default values for ServiceBehavior properties ConcurrencyMode or InstanceContextMode?

In relation to concurrency we have only this in serviceBehaviors:

   <serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="2000" maxConcurrentSessions="1000"/>

What about the ServiceBehavior attributes on your service definitions. For example the WsdlNamespaceSample in SampleServer has this:

namespace Sample
{
    [ServiceBehavior(Namespace = "http://WCFExtrasPlus/Samples/services/2011/4")]
    public class WsdlNamespaceSample : IWsdlNamespaceSample
    {
        public string Operation1(DataContractSample2 data)
        {
            throw new NotImplementedException();
        }
    }
}

Same as in your example - nothing except namespace.

Same as in your example - nothing except namespace.

Please tell me how you solved the problem, since I may have a similar situation in the next issues.

#10

We recompilled your library with ConcurrentDictionary as a replacement and it resolved the issue.
Therefore I am closing it.

Мы перекомпилировали вашу библиотеку с помощью ConcurrentDictionary в качестве замены, и это устранило проблему.
Поэтому я его закрываю.

Отлично буду пробовать, спасибо!

@Rashair I have a version ready that uses ComponentDictionary. If I pose a pre-release binary or nuget package could you try it out in your environment, since I can't repro locally?