-
Notifications
You must be signed in to change notification settings - Fork 16
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
remove usage of jruby-stdin-channel #19
base: main
Are you sure you want to change the base?
remove usage of jruby-stdin-channel #19
Conversation
There is still an open issue on jruby about stdin's interruptibility, noting that support may have gotten better on linux/darwin, but that there may still be issues with Windows: jruby/jruby#2024 |
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.
Assuming that the upstream issues are reliably fixed for all platforms, the changes here look sensible.
I've added a note about explicitly depending on either the Logstash core or the Jruby that provided the fix to ensure those who still need the fix do not resolve to a version of this plugin that still needs it.
@@ -23,7 +23,6 @@ Gem::Specification.new do |s| | |||
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99" | |||
s.add_runtime_dependency "logstash-codec-line" | |||
s.add_runtime_dependency "concurrent-ruby" | |||
s.add_runtime_dependency "jruby-stdin-channel" |
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.
Do we know precisely which version of Logstash and/or Jruby is needed in order to preclude the need for jruby-stdin-channel
? If so we should add that as a requirement so that this update isn't pulled in on Logstashes/Jrubies that still need it.
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.
👍 believe the changes are due to the JRuby 9K IO sub-system rewrite.
so any 9.x should do, either logstash-core >= 6.0
or simply s.required_ruby_version '>= 2.3'
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.
There is still an open issue on jruby about stdin's interruptibility, noting that support may have gotten better on linux/darwin, but that there may still be issues with Windows: jruby/jruby#2024
missed this one, I think it's still an issue - even on Linux/Mac.
we might need a spec checking for in.read
followed by an in.close
not causing a hang (till a char is received).
@kares yeah, I will add a spec for the interruptibility, good suggestion. One thing though, I don't think that plugin specs are run on different platforms are they? Plus we are not running all default plugins specs included in LS as part of the LS build (which does multiple platforms). Any suggestions for that? /cc @jsvd If at least we could have a spec which would indicate what the expected behaviour is with some possible exceptions per platform (Windows) and if that changes it could indicate to look at the stdin plugin to make some changes or something like that? |
if needed we could setup Travis CI's matrix to also run tests on a Windows box. |
@kares that's weird. I did test interruptibility in LS using this PR patched version of the input plugin and it worked. Let me see what I missed here or what the difference is 🤔 |
Got it! @kares as discussed in jruby/jruby#2024 - your test uses |
Ok, so the change in behaviour seems to have happened in 9.1.15.0 so I believe starting at v6.7.0 when we upgraded JRuby from 9.1.13.0 to 9.2.6.0 we did not need the As suggested I could a dependecy such as
I'll also add a spec to test interruptibility to avoid future regression on that. |
Added logstash-core version constrain and a spec. I tested the spec on JRuby version < 9.1.15.0 and it fails on the timeout. |
thanks for explaining the details - have assumed if so this is starting to look good, esp. since there's a specs guarding against potential regressions (hangs). however, I do not think the IO logic is the same on Windows - not sure about the exact details but my guess is that the channel won't come back as selectable. any how I did a quick test which confirms |
@kares thanks! |
Yeah, was thinking about that but than there's jruby/jruby#2024 already. |
The interruptible stdin implementation in in https://github.com/colinsurprenant/jruby-stdin-channel is not required anymore in this plugin, the current JRuby stdin in now interruptible.
Relates to elastic/logstash#12071