Skip to content

Commit

Permalink
Merge pull request #2778 from fluent/do-not-use-hash-to-metadata-on-w…
Browse files Browse the repository at this point in the history
…indows

Don't use timekey.object_id for Metadata instance comparison on Windows. Fix #2713
  • Loading branch information
cosmo0920 authored Jan 17, 2020
2 parents a353793 + 941012a commit cf2bc0b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/fluent/plugin/buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ def <=>(o)
# Actually this overhead is very small but this class is generated *per chunk* (and used in hash object).
# This means that this class is one of the most called object in Fluentd.
# See https://github.com/fluent/fluentd/pull/2560
# But, this optimization has a side effect on Windows due to differing object_id.
# This difference causes flood of buffer files.
# So, this optimization should be enabled on non-Windows platform.
def hash
timekey.object_id
end
end unless Fluent.windows?
end

# for tests
Expand Down

0 comments on commit cf2bc0b

Please sign in to comment.