elastomer-client 3.1.3 → 3.1.4

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
  SHA1:
3
- metadata.gz: ee5ef212d2d3fefeef8794a4b25901237a989ded
4
- data.tar.gz: 3434bb50acbebd5cf4a8d98a2bff8e2fe8863dd8
3
+ metadata.gz: 95877a6edd1749905c0b9636c0b42d79e2f3cd18
4
+ data.tar.gz: cb55f7960a4641fa174c04ba01323dfac7e7d277
5
5
  SHA512:
6
- metadata.gz: 92a3b002a675a1937360c01670df306e91af406b7bed2402f08094bf4e077d81cee56f961287ea38b702c5f0f0d994d77a4a55efe34261d47e9b5bf62d4e49f7
7
- data.tar.gz: '02297cdcb7c4305b2d9e5e20edb7ac9247ba4f0daae03feec88c09621257d57adc5b482e9ea405cc01f7a515486898eb21f97dcb747d853fb2700ab585f93e94'
6
+ metadata.gz: 33ee2ea6983e25ab5a497da860079b021cc638ee735381cb35f3db59d7ae8f84698f9b529d946d6db8d27bf59f16754eebc4da9e52dfb2ca00e89e27a9dae7eb
7
+ data.tar.gz: dae314923477e94be91faac9da04468d02bdbfa9dc7882db676d5cba04205fc9a13d8f7cd36dc75881846c5a7c71c5c6c0923dae4bf31841f4bda31e959f99d4
@@ -407,6 +407,7 @@ module Elastomer
407
407
  case root_cause["type"]
408
408
  when "index_not_found_exception"; raise IndexNotFoundError, response
409
409
  when "illegal_argument_exception"; raise IllegalArgument, response
410
+ when "es_rejected_execution_exception"; raise RejectedExecutionError, response
410
411
  when *version_support.query_parse_exception; raise QueryParsingError, response
411
412
  end
412
413
 
@@ -85,13 +85,15 @@ module Elastomer
85
85
 
86
86
  # Provide some nice errors for common Elasticsearch exceptions. These are
87
87
  # all subclasses of the more general RequestError
88
- IndexNotFoundError = Class.new RequestError
89
- QueryParsingError = Class.new RequestError
90
- SearchContextMissing = Class.new RequestError
91
-
92
- ServerError.fatal = false
93
- TimeoutError.fatal = false
94
- ConnectionFailed.fatal = false
88
+ IndexNotFoundError = Class.new RequestError
89
+ QueryParsingError = Class.new RequestError
90
+ SearchContextMissing = Class.new RequestError
91
+ RejectedExecutionError = Class.new RequestError
92
+
93
+ ServerError.fatal = false
94
+ TimeoutError.fatal = false
95
+ ConnectionFailed.fatal = false
96
+ RejectedExecutionError.fatal = false
95
97
 
96
98
  # Define an Elastomer::Client exception class on the fly for
97
99
  # Faraday exception classes that we don't specifically wrap.
@@ -1,5 +1,5 @@
1
1
  module Elastomer
2
- VERSION = "3.1.3"
2
+ VERSION = "3.1.4"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -1 +1 @@
1
- script/cibuild-elastomer-client-es24
1
+ cibuild-elastomer-client-es24
@@ -71,6 +71,7 @@ describe Elastomer::Client::Error do
71
71
  assert !Elastomer::Client::TimeoutError.fatal, "Timeouts are not fatal"
72
72
  assert !Elastomer::Client::ConnectionFailed.fatal, "Connection failures are not fatal"
73
73
  assert !Elastomer::Client::ServerError.fatal, "Server errors are not fatal"
74
+ assert !Elastomer::Client::RejectedExecutionError.fatal, "Rejected execution errors are not fatal"
74
75
  end
75
76
 
76
77
  if parameter_validation?
@@ -33,6 +33,30 @@ describe Elastomer::Client do
33
33
  end
34
34
  end
35
35
 
36
+ it "raises an error on rejected execution exceptions" do
37
+ rejected_execution_response = {
38
+ error: {
39
+ root_cause: [{
40
+ type: "es_rejected_execution_exception",
41
+ reason: "rejected execution of org.elasticsearch.transport.TransportService$7@5a787cd5 on EsThreadPoolExecutor[bulk, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@1338862c[Running, pool size = 32, active threads = 32, queued tasks = 213, completed tasks = 193082975]]"
42
+ }],
43
+ type: "es_rejected_execution_exception",
44
+ reason: "rejected execution of org.elasticsearch.transport.TransportService$7@5a787cd5 on EsThreadPoolExecutor[bulk, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@1338862c[Running, pool size = 32, active threads = 32, queued tasks = 213, completed tasks = 193082975]]"
45
+ }
46
+ }.to_json
47
+
48
+ stub_request(:post, $client.url+"/_bulk").to_return({
49
+ body: rejected_execution_response
50
+ })
51
+
52
+ begin
53
+ $client.post "/_bulk"
54
+ assert false, "exception was not raised when it should have been"
55
+ rescue Elastomer::Client::RejectedExecutionError => err
56
+ assert_match %r/es_rejected_execution_exception/, err.message
57
+ end
58
+ end
59
+
36
60
  it "wraps Faraday errors with our own exceptions" do
37
61
  error = Faraday::TimeoutError.new("it took too long")
38
62
  wrapped = $client.wrap_faraday_error(error, :get, "/_cat/indices")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastomer-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-07-02 00:00:00.000000000 Z
12
+ date: 2019-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
341
  version: '0'
342
342
  requirements: []
343
343
  rubyforge_project:
344
- rubygems_version: 2.6.13
344
+ rubygems_version: 2.5.2
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: A library for interacting with Elasticsearch