Summary: | Data race inside the non-thread-safe HashMap org.apache.catalina.connector.OutputBuffer.encoders | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Yilong Li <yilong.li> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | ---- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Yilong Li
2015-09-01 13:34:55 UTC
I agree that this is an issue. A switch to ConcurrentHashMap should address the immediate problem. The idea behind clearEncoders() is a good one. The encoders are expensive objects and don't scale well. We don't really want to keep the Map around during an async request. On the otherhand, we don't really want to have to keep re-creating it. I'm wondering about ways to improve the currenty approach. I'm going to do some simple testing to see how an approach based on pools of encoders would perform. Fixed in trunk, 8.0.x (for 8.0.27 onwards) and 7.0.x (for 7.0.65 onwards). Back-port proposed for 6.0.x. |