[JAVA-732] Thread Locals not being freed in thread pool Created: 15/Jan/13 Updated: 10/Mar/13 Resolved: 10/Mar/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 2.10.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Taylor | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java |
||
| Issue Links: |
|
||||||||
| Description |
|
We are seeing thread local data being left on threads in the thread https://jira.mongodb.org/browse/JAVA-596 In Here is the patch we have introduced to your 2.9.10 distribution: — src/main/com/mongodb/DBTCPConnector.java.orig 2012-12-03 /** + |
| Comments |
| Comment by Jeffrey Yemin [ 10/Mar/13 ] |
|
Duplicate of |
| Comment by Olivier Allouch [ 05/Mar/13 ] |
|
Reloading my webapp causes PermGen exceptions. It may be related to this issue. |
| Comment by David Taylor [ 17/Jan/13 ] |
|
We have not yet experienced any side effects, though we are concerned with thread pool reused state. Tomcat tries to deal with this by killling the threads in the thread pool. We dont know how successful they are because we dont reload Tomcat (currently). Having SEVERE errors in the logs that we have to train others to ignore is not "correct behavior" |
| Comment by Jeffrey Yemin [ 17/Jan/13 ] |
|
My question is really about whether you are seeing any actual problems in the behavior of your application, or is it only the Tomcat reports that are a concern? Either way it's a problem, but it's more serious if there is incorrect behavior in addition to the warnings from Tomcat. |
| Comment by David Taylor [ 15/Jan/13 ] |
| Comment by David Taylor [ 15/Jan/13 ] |
|
With no API available to clear the TLS state, TLS memory is left on the web request threads. In a pooled request thread environment, these can result in cross request state contamination. furthermore, web application reloading cannot complete properly as long as these threads hold onto these objects in unloaded applications. Tomcat reports these TLS leaks per thread on shutdown as a diagnositic tool to warn developers of these portential problems. |
| Comment by Jeffrey Yemin [ 15/Jan/13 ] |
|
Hi David, Can you characterize the seriousness of the problem? Is it that memory is being wasted, or that the application is behaving incorrectly as a result? Are you calling this release method at the end of every request? |