logstash/rakelib/childprocess_patch.rb
Pier-Hugues Pellerin 76286b4f0e use jruby 9.1.9.0
Work done by @guyboertje and @ph

Since JRuby 1.7.25 is now EOL we are migrating Logstash to use JRuby 9k and JDK8 only,
Not much needed updating to make this work, its was mostly a drop in replacement from the previous version.

The major point was the change in the implementation of Time in JRuby, JRuby now use `java.time`
instead of joda time, this allow JRuby to have nanoseconds precision on time object.
2017-06-12 12:35:10 -04:00

20 lines
537 B
Ruby

# This is a patch for childprocess and this is due to ruby-cabin/fpm interaction.
# When we use the logger.pipe construct and the IO reach EOF we close the IO.
# The problem Childprocess will try to flush to it and hit an IOError making the software crash in JRuby 9k.
#
# In JRuby 1.7.25 we hit a thread death.
#
module ChildProcess
module JRuby
class Pump
alias_method :old_pump, :pump
def ignore_close_io
old_pump
rescue IOError
end
alias_method :pump, :ignore_close_io
end
end
end