Pass chunk directly instead of chunk metadata - #63
Conversation
extract_placeholders should be passed chunk instance directly instead of chunk.metadata. Signed-off-by: Hiroshi Hatake <cosmo0920.oucc@gmail.com>
Signed-off-by: Hiroshi Hatake <cosmo0920.oucc@gmail.com>
|
Thanks for this fix, @cosmo0920 — and apologies it sat unreviewed for so long. 🙏 This is correct. In current Fluentd, # fluentd lib/fluent/plugin/output.rb
def extract_placeholders(str, chunk)
metadata = if chunk.is_a?(Fluent::Plugin::Buffer::Chunk)
chunk_passed = true
chunk.metadata
else
chunk_passed = false
# For existing plugins. Old plugin passes Chunk.metadata instead of Chunk
chunk
end
...Besides aligning with the current API, passing the chunk also enables the I applied this on top of the current code and ran the full suite (including new real-connection integration tests) on Ruby 3.4 / Fluentd 1.19.2 against MySQL 8.4 — all green (18 tests, 63 assertions, 0 failures). The LGTM 👍 I'd like to merge this once the new GitHub Actions CI (#72) lands so it runs through CI; a quick rebase on top of that would be ideal. Thanks again for the fix! |
|
@tagomoris @toyama0919 I'll organize some of the pending pull requests and issues. |
extract_placeholders should be passed chunk instance directly instead of chunk.metadata.