-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make copy of appender list when removing all, for increased thread-safety #222
base: master
Are you sure you want to change the base?
Conversation
@tmct thanks for your pull request. I would prefer the pattern already used in AppendLoopOnAppenders(): _appenderArray ??= _appenderList.ToArray();
foreach (IAppender appender in _appenderArray) Can you adjust the code? |
Yes of course, consistency can be very useful! Thank you. |
Hi @FreeAndNil - I had a look and I don't think the private I've removed it everywhere if that's ok? |
@tmct the _appenderArray had the advantage to copy the contents only once into an array. I'm currently considering switching to System.ComponentModel.Collections.Collection as base class. |
Ah yes you could be right, this could specifically have a performance impact in AppendLoopOnAppenders, being the method among these that we expect to be called frequently without a change in the list, the problem being the repeated filing of the same array. I can address that later today or Monday, thanks. |
@tmct Will you find the time to complete within this week? |
Hi @FreeAndNil, I'm not sure, sorry. I will try to though. Apologies - work became busy. |
Hi @tmct, hope you're doing well! Just checking in on this. Do you have an estimated timeframe for when this will be completed? Thanks. |
Hello,
We have been witnessing this error now and again while using log4net 2.0.15:
It looks like the code on master is still susceptible to this, what do you think of this change? (The try-catch should be wel-equipped to handle appenders that have left the List, so long as we can still access their name for the error message...)
Thanks,
Tom