Per discussion in #11492 (comment) per @yaauie observation:
Note that WorkerLoop.THREAD_CONTEXT is a ThreadLocal, so each java thread can pull its own ruby thread context out. The trouble arises if and when a java thread ever runs multiple ruby threads in the course of its lifetime (which I do not know), since we only populate it with ThreadLocal#withInitial and then use WorkerLoop.THREAD_CONTEXT in to pass a ThreadContext to various ruby internals that then use it to determine interrupt state.
This is the code in question:
|
public static final ThreadLocal<ThreadContext> THREAD_CONTEXT = |
|
ThreadLocal.withInitial(RubyUtil.RUBY::getCurrentContext); |
We should investigate further into this.
Per discussion in #11492 (comment) per @yaauie observation:
This is the code in question:
logstash/logstash-core/src/main/java/org/logstash/execution/WorkerLoop.java
Lines 19 to 20 in 5c4d353
We should investigate further into this.