Details
-
Bug
-
Status: Resolved (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
RequestHandlerThreads seem to get stuck in parsing test results. We have multiple times seen in the thread dump traces like this:
"Handling GET /hudson/job/.../190/ : RequestHandlerThread10" Id=328 Group=main RUNNABLE
at java.util.WeakHashMap.get(WeakHashMap.java:355)
at hudson.tasks.test.TestObject.uniquifyName(TestObject.java:335)
- locked hudson.tasks.junit.CaseResult@3f7e9c00
at hudson.tasks.junit.CaseResult.getSafeName(CaseResult.java:223)
"Handling GET /hudson/job/.../lastCompletedBuild/testReport/ : RequestHandlerThread29" Id=18760 Group=main RUNNABLE
at java.util.WeakHashMap.get(WeakHashMap.java:355)
at hudson.tasks.test.TestObject.uniquifyName(TestObject.java:335)
- locked hudson.tasks.junit.CaseResult@592d41ae
at hudson.tasks.junit.CaseResult.getSafeName(CaseResult.java:223)
It looks a lot like e.g. https://issues.apache.org/jira/browse/BEANUTILS-318
With my limited Java skills it would appear like the static map UNIQUIFIED_NAMES could be accessed by multiple threads simultaneously through different instances of TestObjects.
Also when this happens, there are as many threads busy looping as threadDump shows threads stuck in WeakHashMap.get().
We made a modification to our Hudson installation like described in that apache bug report (i.e. wrap the WeakHashMap inside Collection.Synchronized) and haven't yet seen this reoccurring, and everything else seems to work normally.