deimos-ruby 1.23.1.pre.beta2 → 1.23.1.pre.beta3

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: 8eb813b95fd050b52f626abce1487f2fdbe6fcd03525125dbfa73a486a92ea2f
4
- data.tar.gz: ae81a6229db39885b81b2cb68e53a082f968efdc08c277b068fb4f6bad841e19
3
+ metadata.gz: 89259c86278401bf810b90ec9b611cda1e7fd8fc9d35a0bace0c5fe8ffdc58ae
4
+ data.tar.gz: eb14298f1b4facd22ef4ce80b0d412dc4b416a49c6c7c3fd82a5517ac4bd1629
5
5
  SHA512:
6
- metadata.gz: bb5d4e1cdc9b4a481e92d67a2601b64461240d91db4bc695d4adc1a9537d66cd8f752b12c0e6021d991e4f601a0f51790ff14fac99cc0920e0edc495f3d634d3
7
- data.tar.gz: 1dc7343e4edc13d209822def4a143f97bfbafa03b94abef66e163e5e4c95013a045390a70e120f9752e9193456a0fbc7dc6817bdd1790386cda3863e695ce67a
6
+ metadata.gz: 20cb3e0bcfc150c6e1e7905f8514d1e73ac557e3f28fe71c3879dac4a84b349c66b148f6a8a248ecad1f348b474462b0fe038353ce1fbf23340ba1698f6ffd78
7
+ data.tar.gz: f539adc543e4eef62d2477e1f4a2342952b9384190b8520460b59077781c5638b344a870d196e90bd689a1de62db0ac03e4d2317865007566f4c4c73591ba509
@@ -48,7 +48,6 @@ module Deimos
48
48
  # @param event [ActiveSupport::Notifications::Event]
49
49
  # @return [void]
50
50
  def self.send_produce_error(event)
51
- Rails.logger.info(event)
52
51
  exception = event.payload[:exception_object]
53
52
  return unless exception
54
53
 
@@ -105,6 +105,17 @@ module Deimos
105
105
  raise Deimos::MissingImplementationError
106
106
  end
107
107
 
108
+ # @param span [Object]
109
+ # @param e [Exception]
110
+ def set_error_and_retry(span, e)
111
+ span.set_error(e)
112
+ span.finish
113
+ Deimos.config.tracer&.start(
114
+ 'deimos-db-poller',
115
+ resource: @resource_class.name.gsub('::', '-')
116
+ )
117
+ end
118
+
108
119
  # @param batch [Array<ActiveRecord::Base>]
109
120
  # @param status [PollStatus]
110
121
  # @return [Boolean]
@@ -119,12 +130,14 @@ module Deimos
119
130
  Deimos.config.tracer&.finish(span)
120
131
  status.batches_processed += 1
121
132
  rescue Kafka::Error => e # keep trying till it fixes itself
133
+ span = set_error_and_retry(span, e)
122
134
  Deimos.config.logger.error("Error publishing through DB Poller: #{e.message}")
123
135
  sleep(0.5)
124
136
  retry
125
137
  rescue StandardError => e
126
138
  Deimos.config.logger.error("Error publishing through DB poller: #{e.message}}")
127
139
  if @config.retries.nil? || retries < @config.retries
140
+ span = set_error_and_retry(span, e)
128
141
  retries += 1
129
142
  sleep(0.5)
130
143
  retry
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.23.1-beta2'
4
+ VERSION = '1.23.1-beta3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.1.pre.beta2
4
+ version: 1.23.1.pre.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner