Merged
Conversation
Member
Author
|
@repeatedly Could you review this change? |
repeatedly
reviewed
Oct 23, 2017
lib/fluent/plugin/buffer.rb
Outdated
| return 1 | ||
| end | ||
| # both of v1 and v2 are non-nil | ||
| if v1.keys.sort != v2.keys.sort |
Member
There was a problem hiding this comment.
v1.keys and v2.keys should be assigned to local variables because each keys call creates new object.
metadata comparison is called heavily in buffers so reducing object allocation is better.
Member
|
BTW... with this patch, https://github.com/fluent/fluentd/blob/master/test/plugin/test_buffer.rb#L861 this assertion always fails. |
32c5f58 to
2369a4a
Compare
Member
Author
|
I've pushed commits to fix performance issue and existing tests. |
Member
|
Thx! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When 2 or more input plugin threads try to emit events into an output plugin (and its buffer plugin instance), it may occur dead-lock, because the order of chunks to be locked are random for now.
This change introduces to sort metadata before locking chunks, to lock chunks in same order in different threads.