Concurrent access to not synchronized HashMap

Description

We use stripes for a long time but today several threads hung with such stack-trace:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Thread[a STR HTTP-XXX.action?,5,main] class org.apache.tomcat.util.threads.TaskThread java.util.HashMap.getEntry(HashMap.java:446) java.util.HashMap.containsKey(HashMap.java:434) net.sourceforge.stripes.controller.BindingPolicyManager.getInstance(BindingPolicyManager.java:81) net.sourceforge.stripes.controller.DefaultActionBeanPropertyBinder.isBindingAllowed(DefaultActionBeanPropertyBinder.java:256) net.sourceforge.stripes.controller.DefaultActionBeanPropertyBinder.bind(DefaultActionBeanPropertyBinder.java:153) net.sourceforge.stripes.controller.DispatcherHelper$3.intercept(DispatcherHelper.java:218) net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158) net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113) net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74) net.sourceforge.stripes.controller.DispatcherHelper.doBindingAndValidation(DispatcherHelper.java:214) net.sourceforge.stripes.controller.DispatcherServlet.doBindingAndValidation(DispatcherServlet.java:254) net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:148) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

AFAIK, that is how not-synchronized java hash map react to concurrent modification.

Possible solutions include update HashMap to ConcurrentHashMap, use of Collections.synchronizedMap(), put synchronized keyword to BindingPolicyManager.getInstance().

Environment

None

Status

Assignee

Unassigned

Reporter

Andrei

Labels

None

Tester

None

Components

Affects versions

Release 1.5.7

Priority

Critical
Configure