Niklas Gustavsson wrote:
On Sun, Mar 9, 2008 at 11:38 PM, Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:
Niklas Gustavsson wrote:
 > When doing some load testing on FtpServer, I ran into a threading
 > issue in MdcInjectionFilter.
 This error might be something different than a threading issue. This is
 a typical error you get when doing a loop on a HashMap, and inside the
 loop, you remove the current element and expect the loop to continue.

 Switching to another kind of structure should fix this problem, without
 changing a lot of code.

Yes, the MdcInjectionFilter iterates over a Map containing the current
context, at the same time, setProperty() adds an entry to the same
Map.. Changing the currently used HashMap into a ConcurrentHashMap
fixes the issue for me. Now, ConcurrentHashMap does not allow null
keys or values, but from what I can see, we do not allow null keys and
treats null values as a removal, so that should be fine. Did I miss
anything or would you like me to make that change?
Just check that this change is compatible with the JVM version we are using.

I don't remember if MINA should still be compatible with 1.4, and if ConcurrentHashMap is avaialable in 1.4...
/niklas



--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to