Skip to content
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

Fix to prevent overwriting reserved placeholder keys such as tag #1176

Merged

Conversation

sonots
Copy link
Member

@sonots sonots commented Aug 21, 2016

when same keys exist in record. The bug appeared only with on enable_ruby false

Same thing with sonots/fluent-plugin-record-reformer#42

@@ -194,6 +194,7 @@ def preprocess_map(value, force_stringify = false)

def prepare_placeholders(placeholder_values)
placeholders = {}
reserved_keys = Set.new(placeholder_values.keys)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this Set needed?
Does placeholder_values.include?(k) have a problem?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, but for readability.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating Set needs much resources.
I think plugin should keep lower resources.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, fixed

@sonots sonots force-pushed the prevent_overwriting_reserved_placeholders branch from 8885773 to 28470d0 Compare August 21, 2016 23:10
@repeatedly repeatedly merged commit 89b32d8 into fluent:master Aug 21, 2016
@sonots sonots deleted the prevent_overwriting_reserved_placeholders branch August 22, 2016 00:40
repeatedly added a commit that referenced this pull request Sep 5, 2016
…ceholders

Fix to prevent overwriting reserved placeholder keys such as tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants