deimos-ruby 1.23.1.pre.beta3 → 1.23.1.pre.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deimos/instrumentation.rb +2 -0
- data/lib/deimos/utils/db_poller/base.rb +0 -13
- data/lib/deimos/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcabc5df2ee121cfeb1616d40225130dc55585385b46c38acaf331a048027bb5
|
4
|
+
data.tar.gz: 2e531da904466c33a91a949e8155862b3220dc7b0b13e2003846f535f06a9932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3df2faa4a5b1d1a52dcd62df7517af969ecbbe40fb6179c2ece9961877a22946327f285827053e1a7f88278fc0a0b9530e1c729219d02a936f144a875b9ba4c2
|
7
|
+
data.tar.gz: bd5ce8c1ba81ffbf875d873c2990a7bf22cf6d914e77320f930988bd873dbc8cf871fd8796425505dd118fd8b5d1d47e881b076d2316e1a43aed5486c84d7327
|
@@ -49,6 +49,7 @@ module Deimos
|
|
49
49
|
# @return [void]
|
50
50
|
def self.send_produce_error(event)
|
51
51
|
exception = event.payload[:exception_object]
|
52
|
+
Rails.logger.info("Exception: #{exception}")
|
52
53
|
return unless exception
|
53
54
|
|
54
55
|
if exception.respond_to?(:failed_messages)
|
@@ -85,6 +86,7 @@ module Deimos
|
|
85
86
|
|
86
87
|
ActiveSupport::Notifications.subscribe('deliver_messages.producer.kafka') do |*args|
|
87
88
|
event = ActiveSupport::Notifications::Event.new(*args)
|
89
|
+
Rails.logger.info(event.payload)
|
88
90
|
KafkaListener.send_produce_error(event)
|
89
91
|
end
|
90
92
|
end
|
@@ -105,17 +105,6 @@ 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
|
-
|
119
108
|
# @param batch [Array<ActiveRecord::Base>]
|
120
109
|
# @param status [PollStatus]
|
121
110
|
# @return [Boolean]
|
@@ -130,14 +119,12 @@ module Deimos
|
|
130
119
|
Deimos.config.tracer&.finish(span)
|
131
120
|
status.batches_processed += 1
|
132
121
|
rescue Kafka::Error => e # keep trying till it fixes itself
|
133
|
-
span = set_error_and_retry(span, e)
|
134
122
|
Deimos.config.logger.error("Error publishing through DB Poller: #{e.message}")
|
135
123
|
sleep(0.5)
|
136
124
|
retry
|
137
125
|
rescue StandardError => e
|
138
126
|
Deimos.config.logger.error("Error publishing through DB poller: #{e.message}}")
|
139
127
|
if @config.retries.nil? || retries < @config.retries
|
140
|
-
span = set_error_and_retry(span, e)
|
141
128
|
retries += 1
|
142
129
|
sleep(0.5)
|
143
130
|
retry
|
data/lib/deimos/version.rb
CHANGED