New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: (move and) make get_thread_id "nil safe" #11458
Conversation
(other part of same method assume JRuby already)
Can you please backport to 7.4.3 release as well? |
necessary since native (Java) thread is kept as a weak ref so un-wrapping should deal with a potentially GCd instance resolves elasticGH-11450
ba6a6d0
to
9cc0490
Compare
there isn't another 7.4 release planned atm, this might end up in 7.5.2 or otherwise at 7.6.0 |
@@ -37,18 +35,10 @@ def self.set_thread_plugin(plugin) | |||
Thread.current[:plugin] = plugin | |||
end | |||
|
|||
def self.get_thread_id(thread) | |||
if RUBY_ENGINE == "jruby" | |||
JRuby.reference(thread).native_thread.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reason for moving the method to native is the JRuby.reference
usage.
... a bit unfortunate API as it has side effects on (self) reflecting JRuby's Java classes
as of the date having this classes present some issues at runtime e.g. when looping through Class objects
LGTM |
(other part of same method assume JRuby already) Fixes #11458
(other part of same method assume JRuby already) Fixes #11458
necessary since native (Java) thread is kept as a weak ref
so un-wrapping should deal with a potentially GCd instance
resolves GH-11450