beetle 2.2.0 → 2.2.1

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: 136ef3ee13c61c833081834cca6ad34323af71328f3ec1f21b6aa412167cf1a2
4
- data.tar.gz: 026b2705d3b6d202b756ff6da3b56a385da5dc16453e2099419fe69c7f69905f
3
+ metadata.gz: 84342deeb60438e7eb1b8b5d1fc5c2785d0cb149c05d27783fd1a5415ca89fb9
4
+ data.tar.gz: fd6983f951df29e06446ac5923881d03055198b8d3d71fa7d0d60ab9e626ed7e
5
5
  SHA512:
6
- metadata.gz: 40233f2af492cccd37792173a1541dc6f3bb55c59a1709fec2d2fb437ff62d12e3ff6d0243284a142dd0b8d51dacf2e5d2b45afd2bd244e8f5eae6dbdbd81257
7
- data.tar.gz: 4dc724d9f5566102642191bc0628b83fc9b933f6a03418b5f9e5dbb0433e66ec8d6450d91d3ba7593d4436b91d5511a297287db393970d4aba30d5856cd269fb
6
+ metadata.gz: 16c5d3f44758b727bdaa85c27c9c574773568c358f7265cbf09c63f90f1bfef340ec5fae75013fc91a54252af4f81b33ab3cf332f91fde0aec2708a640dcde47
7
+ data.tar.gz: f601c50aaa542975cbf7a79b58f166825216ec496291989237f8904115b1260faaa6c8dd7e89586882150ac82c4f4f78209969347785571e09971d85dc5b2f17
@@ -1,5 +1,8 @@
1
1
  = Release Notes
2
2
 
3
+ == Version 2.2.1
4
+ * Subscriber exits with meaningful error log on possible authentication failures.
5
+
3
6
  == Version 2.2.0
4
7
 
5
8
  * Support specifying a whitelist of retriable exceptions when registering a
@@ -217,7 +217,8 @@ module Beetle
217
217
  {
218
218
  :host => current_host, :port => current_port, :logging => false,
219
219
  :user => @client.config.user, :pass => @client.config.password, :vhost => @client.config.vhost,
220
- :on_tcp_connection_failure => on_tcp_connection_failure
220
+ :on_tcp_connection_failure => on_tcp_connection_failure,
221
+ :on_possible_authentication_failure => on_possible_authentication_failure,
221
222
  }
222
223
  end
223
224
 
@@ -228,6 +229,13 @@ module Beetle
228
229
  end
229
230
  end
230
231
 
232
+ def on_possible_authentication_failure
233
+ Proc.new do |settings|
234
+ logger.error "Beetle: possible authentication failure, or server overloaded: #{server_from_settings(settings)}. shutting down!"
235
+ stop!
236
+ end
237
+ end
238
+
231
239
  def on_tcp_connection_loss(connection, settings)
232
240
  # reconnect in 10 seconds, without enforcement
233
241
  logger.warn "Beetle: lost connection: #{server_from_settings(settings)}. reconnecting."
@@ -1,3 +1,3 @@
1
1
  module Beetle
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
@@ -377,9 +377,10 @@ module Beetle
377
377
  assert_equal RC::ExceptionsLimitReached, message.__send__(:process_internal, proc)
378
378
  end
379
379
 
380
+ class RegisteredException < StandardError; end
381
+
380
382
  test "a message should not be acked if the handler crashes and the exception has been registered" do
381
383
  header = header_with_params({})
382
- RegisteredException = Class.new(StandardError)
383
384
  message = Message.new("somequeue", header, 'foo', :timeout => 10.seconds, :exceptions => 2,
384
385
  :retry_on => [RegisteredException], :store => @store)
385
386
  assert !message.attempts_limit_reached?
@@ -394,10 +395,10 @@ module Beetle
394
395
  assert_equal RC::HandlerCrash, message.__send__(:process_internal, proc)
395
396
  end
396
397
 
398
+ class OtherException < StandardError; end
399
+
397
400
  test "a message should be acked if the handler crashes and the exception has not been registered" do
398
401
  header = header_with_params({})
399
- RegisteredException = Class.new(StandardError)
400
- OtherException = Class.new(StandardError)
401
402
  message = Message.new("somequeue", header, 'foo', :timeout => 10.seconds, :exceptions => 2,
402
403
  :retry_on => [RegisteredException], :store => @store)
403
404
  assert !message.attempts_limit_reached?
@@ -428,6 +428,13 @@ module Beetle
428
428
  cb.call(@settings)
429
429
  end
430
430
 
431
+ test "possible authentication failure causes subscriber to exit" do
432
+ cb = @sub.send(:on_possible_authentication_failure)
433
+ @sub.expects(:stop!)
434
+ @sub.logger.expects(:error).with("Beetle: possible authentication failure, or server overloaded: mickey:42. shutting down!")
435
+ cb.call({:host => "mickey", :port => 42})
436
+ end
437
+
431
438
  test "tcp connection loss handler tries to reconnect" do
432
439
  connection = mock("connection")
433
440
  connection.expects(:reconnect).with(false, 10)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beetle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-07-31 00:00:00.000000000 Z
15
+ date: 2018-08-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: uuid4r