Open
Description
I'm using a ThreadContextElement
that sets value of a ThreadLocal
. After resolving of #985 it worked perfectly.
But after upgrade to 1.5.0 I've got a similar problem: sometimes the last value of the thread local stucks in a worker thread.
Equivalent code:
while(true) {
someCode {
// here the thread local may already have a value from previous iteration
withContext(threadLocal.asContextElement("foo")) {
someOtherCode()
}
}
}
Actual code of the ThreadContextElement
implementation is here.
It is hard to reproduce the issue, but I'm facing it periodically in production (it may take hours or days to arise).
Tested 1.5.0 and 1.5.2, both behaves the same. Running it with -ea
.