phobos 2.1.2 → 2.1.4

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: 687b8d954c8b21b656aaf41d7d4112d3e100d8845de0bd85436d38ebec4f6934
4
- data.tar.gz: 8ed5b722c0b45e936092a6baab59302ba227fca3a243c24d97913050d3f18e71
3
+ metadata.gz: 02e1b97b3d44dffefffea99da0c15393997043598697d88fe3f7c7ab83549193
4
+ data.tar.gz: 4e3ec45a1db997825ace585a1535ac5c1504105afabe0470c0c676f8f301c66a
5
5
  SHA512:
6
- metadata.gz: a12aa12ad91cdc2a681eea54c5a1db0f8d55cd16c79d7c02c0dc97f58152c1a7111e54455a66e8dda6eb38eee752894d2a74bad29f05b07b52fb9bf6ffda33f9
7
- data.tar.gz: da1cb8365cb7504783db26b456de81611d69cd3c943840efef8af5a5688b301c8c736017b3991e6e8fd0feff290c33749d6d0b7ea37913093b28bc6aa7a964cf
6
+ metadata.gz: b249c05f44dfe0dcb0f81b8177dd27a129e4364e0dbcbf8492295d9823473a7de66ee913c088945346a4e1943b3f2226c8106083cf5502d90341b8bb8fbac0eb
7
+ data.tar.gz: f6725f584a75f099bb2b4624338e424f7ba44859ace5c660bfc20d8f5681d663a1cd051381d18f832659f87bd1406d5c8aea3098112876a1f119649b56645be6
data/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
  ``
7
7
  ## UNRELEASED
8
8
 
9
+ ## [2.1.4] - 2022-06-15
10
+
11
+ - Re-raise consuming errors so that threads don't die forever and are retried
12
+
13
+ ## [2.1.3] - 2022-05-13
14
+
15
+ - Rescue and log Kafka::HeartbeatError in batch processing
16
+
9
17
  ## [2.1.2] - 2022-01-27
10
18
 
11
19
  - Fix packaging error.
@@ -4,6 +4,7 @@ module Phobos
4
4
  module Actions
5
5
  class ProcessBatch
6
6
  include Phobos::Instrumentation
7
+ include Phobos::Log
7
8
 
8
9
  attr_reader :metadata
9
10
 
@@ -26,7 +27,11 @@ module Phobos
26
27
  message: message,
27
28
  listener_metadata: @listener_metadata
28
29
  ).execute
29
- @listener.consumer.trigger_heartbeat
30
+ begin
31
+ @listener.consumer.trigger_heartbeat
32
+ rescue Kafka::HeartbeatError => e
33
+ log_warn("Error sending Heartbeat #{e.class.name}-#{e}")
34
+ end
30
35
  end
31
36
  end
32
37
  end
@@ -42,12 +42,11 @@ module Phobos
42
42
 
43
43
  def start
44
44
  @signal_to_stop = false
45
-
46
45
  start_listener
47
46
 
48
47
  begin
49
48
  start_consumer_loop
50
- rescue Kafka::ProcessingError, Phobos::AbortError
49
+ rescue Kafka::ProcessingError, Phobos::AbortError => e
51
50
  # Abort is an exception to prevent the consumer from committing the offset.
52
51
  # Since "listener" had a message being retried while "stop" was called
53
52
  # it's wise to not commit the batch offset to avoid data loss. This will
@@ -55,6 +54,7 @@ module Phobos
55
54
  instrument('listener.retry_aborted', listener_metadata) do
56
55
  log_info('Retry loop aborted, listener is shutting down', listener_metadata)
57
56
  end
57
+ raise e if e.is_a?(Kafka::ProcessingError)
58
58
  end
59
59
  ensure
60
60
  stop_listener
data/lib/phobos/log.rb CHANGED
@@ -13,6 +13,10 @@ module Phobos
13
13
  def log_error(msg, metadata)
14
14
  LoggerHelper.log(:error, msg, metadata)
15
15
  end
16
+
17
+ def log_warn(msg, metadata = {})
18
+ LoggerHelper.log(:warn, msg, metadata)
19
+ end
16
20
  end
17
21
 
18
22
  module LoggerHelper
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phobos
4
- VERSION = '2.1.2'
4
+ VERSION = '2.1.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phobos
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Túlio Ornelas
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2022-01-27 00:00:00.000000000 Z
18
+ date: 2022-06-15 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bundler
@@ -315,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
315
  - !ruby/object:Gem::Version
316
316
  version: '0'
317
317
  requirements: []
318
- rubygems_version: 3.2.22
318
+ rubygems_version: 3.3.5
319
319
  signing_key:
320
320
  specification_version: 4
321
321
  summary: Simplifying Kafka for ruby apps