fluent-plugin-label-router 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 323aeb0b86fedafdcca48546cb3eed9aa7523efa01df41c3f9a46cd069cd76bb
4
- data.tar.gz: b42d4410cdbacabcf49a8eb2f5d8f8be01d3761efb9b436370ba3166a64eaeb3
3
+ metadata.gz: bd6b78faaf79aa156a111780a7dde808623edb45059e75412e839a8f899121ff
4
+ data.tar.gz: 52498b7e26d5d3d9d69edb4c2dc4ae497729c73785ba07b4ffbad474e6ae96ae
5
5
  SHA512:
6
- metadata.gz: 3e0989c5509dda968b509bb1ec2b01f125b83353aaa7347a68364b2412b41eec93187d320d5005dde9d9e9fadda1afb9ce8b6416dcb86771f6646dd0c8ade2ce
7
- data.tar.gz: 5c53945c123e3271223dff6e04d9eb41bbb674c0876ce62f48af49f70b9adb7c90218c8e70899557b9a20215d999434f595e47dfb1f34a55bf817233b5ddf955
6
+ metadata.gz: d89cca1fad117cea4b1a40fbf31ff54d811562165929ba9c1603e40923f694221e2407262c24b867d11edf6d6d9ef452446fbb51d72da63aede210016d3b5a87
7
+ data.tar.gz: 91aa7edd22925ecdae9f05cf1fc1f8f0e7e9fb5cf89b15437db50269112aaf1d44738bde764acb60d3840c9b36566fc819e99d9fff366ed180019711bc2847af
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-label-router"
6
- spec.version = "0.2.2"
6
+ spec.version = "0.2.3"
7
7
  spec.authors = ["Banzai Cloud"]
8
8
  spec.email = ["info@banzaicloud.com"]
9
9
 
@@ -122,13 +122,15 @@ module Fluent
122
122
 
123
123
  def process(tag, es)
124
124
  if @sticky_tags
125
- if @route_map.has_key?(tag)
126
- # We already matched with this tag send events to the routers
127
- @route_map[tag].each do |r|
128
- r.emit_es(tag, es.dup)
125
+ @mutex.synchronize {
126
+ if @route_map.has_key?(tag)
127
+ # We already matched with this tag send events to the routers
128
+ @route_map[tag].each do |r|
129
+ r.emit_es(tag, es.dup)
130
+ end
131
+ return
129
132
  end
130
- return
131
- end
133
+ }
132
134
  end
133
135
  event_stream = Hash.new {|h, k| h[k] = Fluent::MultiEventStream.new }
134
136
  es.each do |time, record|
@@ -141,7 +143,9 @@ module Fluent
141
143
  if r.match?(input_metadata)
142
144
  orphan_record = false
143
145
  if @sticky_tags
144
- @route_map[tag].push(r)
146
+ @mutex.synchronize {
147
+ @route_map[tag].add(r)
148
+ }
145
149
  end
146
150
  if @batch
147
151
  event_stream[r].add(time, record)
@@ -152,7 +156,9 @@ module Fluent
152
156
  end
153
157
  if !@default_router.nil? && orphan_record
154
158
  if @sticky_tags
155
- @route_map[tag].push(@default_router)
159
+ @mutex.synchronize {
160
+ @route_map[tag].add(@default_router)
161
+ }
156
162
  end
157
163
  if @batch
158
164
  event_stream[@default_router].add(time, record)
@@ -170,7 +176,8 @@ module Fluent
170
176
 
171
177
  def configure(conf)
172
178
  super
173
- @route_map = Hash.new { |h, k| h[k] = Array.new }
179
+ @route_map = Hash.new { |h, k| h[k] = Set.new }
180
+ @mutex = Mutex.new
174
181
  @routers = []
175
182
  @default_router = nil
176
183
  @routes.each do |rule|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-label-router
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Banzai Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler