Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.22.0
-
None
-
None
Description
our HandlerBase is setting a boolean value if it's in handler.
I thought by setting it to null I was clearing the ThreadLocal variable, however that's just creating a null entry.
What makes it worst is the fact that threadLocal was non static. as a result we are getting a lot of entries on the ThreadLocal HashMap. as connections come and go, that will generate a leak on the thread.
That will cause threads on the following stack trace to consume a lot of CPU:
at java.lang.ThreadLocal$ThreadLocalMap.expungeStaleEntry(ThreadLocal.java:638)
at java.lang.ThreadLocal$ThreadLocalMap.remove(ThreadLocal.java:520)
at java.lang.ThreadLocal$ThreadLocalMap.access$200(ThreadLocal.java:319)
at java.lang.ThreadLocal.remove(ThreadLocal.java:242)
at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:426)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1341)
at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:881)
Attachments
Issue Links
- links to