[
https://issues.apache.org/jira/browse/WW-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
István Székely updated WW-3461:
-------------------------------
Attachment: thread_dump-20110617-1253.tar.bz2
Unfortunately the threads locked again, even with the patch you provided. The
thread dump shows it locks on the synchronized block when it tries to access
the validatorCache map.
"http-10.1.1.6-8080-106" daemon prio=10 tid=0x0000000041be7800 nid=0x21df
waiting for monitor entry [0x00007f09dcb87000..0x00007f09dcb8f810]
java.lang.Thread.State: BLOCKED (on object monitor)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:81)
- waiting to lock <0x00007f0a30c373c8> (a
java.util.Collections$SynchronizedMap)
at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:121)
You're right regarding the xml reload setting. It was a legacy setting but we
really should not have it on in a production environment and will turn it off.
We can do it only last week and get back to you once we'll have done it.
> Don't hold locks as long when creating validators in
> AnnotationActionValidatorManager
> -------------------------------------------------------------------------------------
>
> Key: WW-3461
> URL: https://issues.apache.org/jira/browse/WW-3461
> Project: Struts 2
> Issue Type: Improvement
> Affects Versions: 2.1.6
> Reporter: Leigh Anderson
> Assignee: Lukasz Lenart
> Fix For: 2.2.3
>
> Attachments: WW-3461.patch, WW-3461.patch,
> thread_dump-20110615-1324.tar.bz2, thread_dump-20110617-1253.tar.bz2,
> validatormanager.patch
>
>
> Under load, the lock held in AnnotationActionValidatorManager.getValidators
> on validatorCache becomes contended. This lock is currently held while all
> the validators are created. The attached patch reduces the scope of the lock
> to just doing the cache lookup + taking a defensive copy of the list of
> validators for that key. This improved throughput and latency in our tests.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira