Skip to content

Commit

Permalink
Merge pull request #513 from kenhys/fix-close
Browse files Browse the repository at this point in the history
Apply PR#468 patch only for 0.12.x.
  • Loading branch information
kenhys authored Jul 30, 2024
2 parents aa8eb29 + c7c35d0 commit aa5bbf6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/fluent/plugin/out_rdkafka2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class Rdkafka::Producer
def close(timeout = nil)
rdkafka_version = Rdkafka::VERSION || '0.0.0'
# Rdkafka version >= 0.12.0 changed its internals
if Gem::Version::create(rdkafka_version) >= Gem::Version.create('0.12.0')
# but reverted in >= 0.13.0
gem_version = Gem::Version::create(rdkafka_version)
if gem_version >= Gem::Version.create('0.12.0') and
gem_version <= Gem::Version.create('0.12.1')
ObjectSpace.undefine_finalizer(self)

return @client.close(timeout)
Expand Down

0 comments on commit aa5bbf6

Please sign in to comment.