Skip to content

Conversation

@cosmo0920
Copy link
Contributor

Ruby 3.0.0 keywords arguments do not permit Hash <-> keyword arguments
interop.
Instead, we should add a double asterisk operator(**) for it.

Otherwise, Fluentd which is working with Ruby 3.0.0 complains the following error:

2021-03-17 11:30:35 +0900 [warn]: #0 Send exception occurred: wrong number of arguments (given 1, expected 0) 2021-03-17 11:30:35 +0900 [warn]: #0 Exception Backtrace : /Users/cosmo/GitHub/fluentd/vendor/bundle/ruby/3.0.0/gems/ruby-kafka-1.3.0/lib/kafka/client.rb:261:in `producer' /Users/cosmo/GitHub/fluentd/vendor/bundle/ruby/3.0.0/gems/fluent-plugin-kafka-0.16.0/lib/fluent/plugin/out_kafka_buffered.rb:242:in `block in get_producer' /Users/cosmo/GitHub/fluentd/vendor/bundle/ruby/3.0.0/gems/fluent-plugin-kafka-0.16.0/lib/fluent/plugin/out_kafka_buffered.rb:239:in `synchronize' /Users/cosmo/GitHub/fluentd/vendor/bundle/ruby/3.0.0/gems/fluent-plugin-kafka-0.16.0/lib/fluent/plugin/out_kafka_buffered.rb:239:in `get_producer' /Users/cosmo/GitHub/fluentd/vendor/bundle/ruby/3.0.0/gems/fluent-plugin-kafka-0.16.0/lib/fluent/plugin/out_kafka_buffered.rb:297:in `write' /Users/cosmo/GitHub/fluentd/lib/fluent/compat/output.rb:131:in `write' /Users/cosmo/GitHub/fluentd/lib/fluent/plugin/output.rb:1136:in `try_flush' /Users/cosmo/GitHub/fluentd/lib/fluent/plugin/output.rb:1448:in `flush_thread_run' /Users/cosmo/GitHub/fluentd/lib/fluent/plugin/output.rb:462:in `block (2 levels) in start' /Users/cosmo/GitHub/fluentd/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create' 2021-03-17 11:30:35 +0900 [info]: #0 initialized kafka producer: kafka 2021-03-17 11:30:35 +0900 [warn]: #0 got unrecoverable error in primary and no secondary error_class=ArgumentError error="wrong number of arguments (given 1, expected 0)" 2021-03-17 11:30:35 +0900 [warn]: #0 suppressed same stacktrace 2021-03-17 11:30:35 +0900 [warn]: #0 bad chunk is moved to /tmp/fluent/backup/worker0/object_d34/5bdb243f97c20c1b6afd71a5bbb07625.log 

Signed-off-by: Hiroshi Hatake cosmo0920.oucc@gmail.com

@cosmo0920 cosmo0920 requested a review from repeatedly March 17, 2021 03:14
@cosmo0920 cosmo0920 self-assigned this Mar 17, 2021
@cosmo0920 cosmo0920 changed the title out_kafka: out_kafka_buffered: Support Ruby 3.0.0 keyword arguments incompatibility out_kafka: out_kafka_buffered: Support Ruby 3.0.0 keyword arguments interop Mar 17, 2021
Ruby 3.0.0 keywords arguments do not permit Hash <-> keyword arguments interop. Instead, we should add a double asterisk operator(`**`) for it. Signed-off-by: Hiroshi Hatake <cosmo0920.oucc@gmail.com>
@cosmo0920 cosmo0920 force-pushed the support-ruby-3.0.0-keyword-arguments-incompatibility branch from 437aa91 to 66151eb Compare March 17, 2021 03:16
@cosmo0920 cosmo0920 merged commit d305862 into master Mar 24, 2021
@cosmo0920 cosmo0920 deleted the support-ruby-3.0.0-keyword-arguments-incompatibility branch March 24, 2021 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants