fluent-plugin-concat 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bde56d6e8baa024582b8bbc7efd938216df7ac9f77516bc43911e8037243887
4
- data.tar.gz: 1aecde24c36f133fc2568ae22e1258c90d38dc08feca441ee33681d1a89b507a
3
+ metadata.gz: 0a119cbc6b5774f81bde44b530ece7292c1f83635d6577155baad7d3c6d9544c
4
+ data.tar.gz: 92c703271e63894f9b56c8a4d3d22c68c79c2ee6e219adb9b934fbb05a7464cf
5
5
  SHA512:
6
- metadata.gz: d265acfd6d96c026fa67ad044946523508599ff7d93304a5d435e9494dfd300ecfa2458d920b0ef1d6e2a4bdb710920dd463d4de77291ef3136f08328179e230
7
- data.tar.gz: facc4c3213e2348842035e8876073b26be69bc8c8e3306038bc66ae3628af52658e0d369c4d8c3e4604fbc6bd0bcb40f87998e5796cb5777b49f15d603edb247
6
+ metadata.gz: cc59b890e0a82eca4a27663f2705f1ae4bf98e2d89c626696f90f523b73310df779cb26b92fdf544aa0e149f3c3e4b97569ea7291475b828ed2378082ec3a0bf
7
+ data.tar.gz: 6b7eca55c66e0a038faf738ff718952a57bbf382881ffc7c03663984ede6f8e34d3219b737f4922ec83e1e82d82d823d64ad4a943e96dc9d8581fac1c78a81ad
data/NEWS.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # ChangeLog
2
2
 
3
+ ## v2.2.3
4
+
5
+ ### Fixes
6
+
7
+ * Fix a bug that `@timeout_map` will be updated while traversing it. See #49
8
+
9
+ ## v.2.2.2
10
+
11
+ ### Fixes
12
+
13
+ * #48
14
+
15
+ ## v2.2.1
16
+
17
+ ### Fixes
18
+
19
+ * #45
20
+
21
+ ## v2.2.0
22
+
23
+ ### Fixes
24
+
25
+ * #43
26
+
3
27
  ## v2.0.0
4
28
 
5
29
  * Use Fluentd v0.14 API and drop Fluentd v0.12 or earlier support
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-concat"
7
- spec.version = "2.2.2"
7
+ spec.version = "2.2.3"
8
8
  spec.authors = ["Kenji Okimoto"]
9
9
  spec.email = ["okimoto@clear-code.com"]
10
10
 
@@ -34,7 +34,10 @@ module Fluent::Plugin
34
34
  super
35
35
 
36
36
  @buffer = Hash.new {|h, k| h[k] = [] }
37
- @timeout_map = Hash.new {|h, k| h[k] = Fluent::Engine.now }
37
+ @timeout_map_mutex = Thread::Mutex.new
38
+ @timeout_map_mutex.synchronize do
39
+ @timeout_map = Hash.new {|h, k| h[k] = Fluent::Engine.now }
40
+ end
38
41
  end
39
42
 
40
43
  def configure(conf)
@@ -119,7 +122,9 @@ module Fluent::Plugin
119
122
  else
120
123
  stream_identity = "#{tag}:default"
121
124
  end
122
- @timeout_map[stream_identity] = Fluent::Engine.now
125
+ @timeout_map_mutex.synchronize do
126
+ @timeout_map[stream_identity] = Fluent::Engine.now
127
+ end
123
128
  case @mode
124
129
  when :line
125
130
  process_line(stream_identity, tag, time, record)
@@ -220,18 +225,20 @@ module Fluent::Plugin
220
225
  def flush_timeout_buffer
221
226
  now = Fluent::Engine.now
222
227
  timeout_stream_identities = []
223
- @timeout_map.each do |stream_identity, previous_timestamp|
224
- next if @flush_interval > (now - previous_timestamp)
225
- next if @buffer[stream_identity].empty?
226
- time, flushed_record = flush_buffer(stream_identity)
227
- timeout_stream_identities << stream_identity
228
- tag = stream_identity.split(":").first
229
- message = "Timeout flush: #{stream_identity}"
230
- handle_timeout_error(tag, @use_first_timestamp ? time : now, flushed_record, message)
231
- log.info(message)
232
- end
233
- @timeout_map.reject! do |stream_identity, _|
234
- timeout_stream_identities.include?(stream_identity)
228
+ @timeout_map_mutex.synchronize do
229
+ @timeout_map.each do |stream_identity, previous_timestamp|
230
+ next if @flush_interval > (now - previous_timestamp)
231
+ next if @buffer[stream_identity].empty?
232
+ time, flushed_record = flush_buffer(stream_identity)
233
+ timeout_stream_identities << stream_identity
234
+ tag = stream_identity.split(":").first
235
+ message = "Timeout flush: #{stream_identity}"
236
+ handle_timeout_error(tag, @use_first_timestamp ? time : now, flushed_record, message)
237
+ log.info(message)
238
+ end
239
+ @timeout_map.reject! do |stream_identity, _|
240
+ timeout_stream_identities.include?(stream_identity)
241
+ end
235
242
  end
236
243
  end
237
244
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-concat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenji Okimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-26 00:00:00.000000000 Z
11
+ date: 2018-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.7.3
143
+ rubygems_version: 2.7.6
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Fluentd Filter plugin to concat multiple event messages