fluent-plugin-elasticsearch 3.5.2 → 3.5.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: ef45e29f8c3a6ff15a0abd5cf6161bc17774c48c84a5d768b33b7b9d0482d9ea
4
- data.tar.gz: 2a05a508cbf5763de05e58e1a3a8a3549a36e85610684fd7365825fbcec1b056
3
+ metadata.gz: 6c5093f6c265f2f0ac3cd14caea2f3fbe35e3ec8298d0c5f7189caeab58303e6
4
+ data.tar.gz: 36feb2e651446883c84b8e41dfceb8f0d16e53920938c623540db83c7ae92a38
5
5
  SHA512:
6
- metadata.gz: 29565f1f6a3a11de6a96ee9961c3361b51cb688bf4dac65702a9977687402af454b55526df3532c628fdf2369e733a65c4dda4526c4f2b896a094d1885c854f2
7
- data.tar.gz: 2970335562ad4bb92e8de45862999ff974b4c76dda3a8257c14d7559ed0a04e91bb37b2aa793d3cfee847637475a27fae59cb8b4d3c49a1962008ce626b0ad1a
6
+ metadata.gz: 858f0656ee19d31d7dde01a0df664269eb350f79c58fe051f4881479a74c11b4448800a04f36bb6c01dbd03800bbf5fa3c3b8ccca0a5a9bb3e1b5a9cb300875d
7
+ data.tar.gz: 2a9bf33a6840fcd246117d362e83524a79544b61a3a19ad977b1407d8bf8577bc5634a71952a34e78f553194b23595341324b451ba18f01b79942b46a40a2984
data/History.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 3.5.3
6
+ - Handle nil items response (#611)
7
+
5
8
  ### 3.5.2
6
9
  - Fix `@meta_config_map` creation timing (#592)
7
10
 
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'fluent-plugin-elasticsearch'
6
- s.version = '3.5.2'
6
+ s.version = '3.5.3'
7
7
  s.authors = ['diogo', 'pitr']
8
8
  s.email = ['pitr.vern@gmail.com', 'me@diogoterror.com']
9
9
  s.description = %q{Elasticsearch output plugin for Fluent event collector}
@@ -56,10 +56,13 @@ class Fluent::Plugin::ElasticsearchErrorHandler
56
56
  next
57
57
  end
58
58
  item = items.shift
59
- if item.has_key?(@plugin.write_operation)
59
+ if item.is_a?(Hash) && item.has_key?(@plugin.write_operation)
60
60
  write_operation = @plugin.write_operation
61
- elsif INDEX_OP == @plugin.write_operation && item.has_key?(CREATE_OP)
61
+ elsif INDEX_OP == @plugin.write_operation && item.is_a?(Hash) && item.has_key?(CREATE_OP)
62
62
  write_operation = CREATE_OP
63
+ elsif item.nil?
64
+ stats[:errors_nil_resp] += 1
65
+ next
63
66
  else
64
67
  # When we don't have an expected ops field, something changed in the API
65
68
  # expected return values (ES 2.x)
@@ -145,6 +145,20 @@ class TestElasticsearchErrorHandler < Test::Unit::TestCase
145
145
  end
146
146
  end
147
147
 
148
+ def test_nil_items_responses
149
+ records = [{time: 123, record: {"foo" => "bar", '_id' => 'abc'}}]
150
+ response = parse_response(%({
151
+ "took" : 0,
152
+ "errors" : true,
153
+ "items" : [{}]
154
+ }))
155
+ chunk = MockChunk.new(records)
156
+ dummy_extracted_values = []
157
+ @handler.handle_error(response, 'atag', chunk, records.length, dummy_extracted_values)
158
+ assert_equal(0, @plugin.error_events.size)
159
+ assert_nil(@plugin.error_events[0])
160
+ end
161
+
148
162
  def test_dlq_400_responses
149
163
  records = [{time: 123, record: {"foo" => "bar", '_id' => 'abc'}}]
150
164
  response = parse_response(%({
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.2
4
+ version: 3.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - diogo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-24 00:00:00.000000000 Z
12
+ date: 2019-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd