These few lines alone are very suspicious indeed. Without further investigations I'm unable to give any sensible feedback.

On 2016-10-31 11:54, Joe wrote:

Another point is that for any asynchronous appender implementation, it’s a sine qua non that the LoggingEvent class be thread-safe.

At least for the manipulations an appender might do: layout, accessing properties, fixing properties.

I had a quick browse through the source and found what looks to me like a race condition here:

publicobjectLookupProperty(stringkey)

             {

if(m_data.Properties != null)

                    {

returnm_data.Properties[key];

                    }

if(m_compositeProperties == null)

                    {

CreateCompositeProperties();

}

returnm_compositeProperties[key];

}

privatevoidCreateCompositeProperties()

             {

                    m_compositeProperties = newCompositeProperties();

if(m_eventProperties != null)

                    {

m_compositeProperties.Add(m_eventProperties);

}

... etc

If two threads call LookupProperty concurrently, one may start executing CreateCompositeProperties and the other might access m_compositeProperties before it’s fully created.

If I’m right, the fix is simple – don’t set m_compositeProperties until it’s completely created.


Reply via email to