https://issues.apache.org/bugzilla/show_bug.cgi?id=54906
Bug ID: 54906 Summary: WebappClassLoader.loadedByThisOrChild can throw ConcurrentModificationException Product: Tomcat 8 Version: trunk Hardware: PC OS: Linux Status: NEW Severity: enhancement Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: apa...@neworld.us Classification: Unclassified Created attachment 30240 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30240&action=edit Patch to catch ConcurrentModificationException while iterating over a collection This is related to bug 54497. A common exception seen in 7.0.33 during stop is a ConcurrentModification in loadedByThisOrChild. java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/mobile/login/oauth]] at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252) at java.util.concurrent.FutureTask.get(FutureTask.java:111) at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1179) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1564) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/mobile/login/oauth]] at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236) ... 7 more Caused by: org.apache.catalina.LifecycleException: Failed to stop component [WebappLoader[/mobile/login/oauth]] at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5521) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) ... 7 more Caused by: java.util.ConcurrentModificationException at java.util.Vector$Itr.checkForComodification(Vector.java:1156) at java.util.Vector$Itr.next(Vector.java:1133) at org.apache.catalina.loader.WebappClassLoader.loadedByThisOrChild(WebappClassLoader.java:2599) at org.apache.catalina.loader.WebappClassLoader.checkThreadLocalMapForLeaks(WebappClassLoader.java:2515) at org.apache.catalina.loader.WebappClassLoader.checkThreadLocalsForLeaks(WebappClassLoader.java:2455) at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1996) at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1902) at org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:661) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) ... 9 more The fix for 54497 stops the exception from failing the stop but it still fails the rest of the ThreadLocal leak check. It would be better if ConcurrentModificationException was caught in loadedByThisOrChild and only that one check fails. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org