Summary: | WebappClassLoader does not cache META-INF/services which leads to performance issues | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Michael Thiele <michael.thiele> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 7.0.28 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Example .war and maven projects for the META-INF/services caching problem |
Description
Michael Thiele
2014-03-20 09:53:08 UTC
Neither the problem nor the solution appear to be that simple. Looking at the ServiceLoader code, the contents of META-INF/services aren't read using the method where the caching was removed. Can you put together a simple test case that demonstrates this issue? Created attachment 31417 [details] Example .war and maven projects for the META-INF/services caching problem I have built a small example of what happens in our code. Deployment in Tomcat 7.0.27 and 7.0.28 should render different results (time needed is increased by factor 10 with META-INF/services) when accessing the root path, e.g., http://localhost:8080/tomcat.caching-0.0.1-SNAPSHOT/. Thanks for the test case. It appears that the ServiceLoader code isn't used and it is clear that the code path where caching was removed is used. I agree that caching the contents META-INF/services id probably the way to go but I think there will need to be some form of limit just in case there is a large file there for some strange reason. I'm looking into a fix now. This has been fixed in 8.0.x for 8.0.5 onwards and in 7.0.x for 7.0.53 onwards. |