waterdrop 2.6.3 → 2.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/waterdrop/errors.rb +3 -2
- data/lib/waterdrop/producer/async.rb +17 -13
- data/lib/waterdrop/producer/sync.rb +17 -13
- data/lib/waterdrop/producer.rb +1 -1
- data/lib/waterdrop/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 908779a6b04cc938fc6f2801d1cd8650191a8cc61db1cda5e8331ca31b2a044e
|
4
|
+
data.tar.gz: 610c8c9e35cc0bd8f1ac47ad34e8e5c36e10283806085c10797ca61cf1761a06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8274e596617d0ba318948f11dda305e8e36819a2f499b8344536a769b576439fcb9a99daaa759d33d2a25629586a5bbff99259ded9682931a8fb5be6357bb2fd
|
7
|
+
data.tar.gz: 9931e5cff829a95398adeac12e22a8461ac3abb0b0001829876495e53b66489ef13896dea7106624602bc1ddc2abcacf2bbd3df107266cbf99c69e5ca84e7e05
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# WaterDrop changelog
|
2
2
|
|
3
|
+
### 2.6.5 (2023-07-22)
|
4
|
+
- [Fix] Add cause to the errors that are passed into instrumentation (konalegi)
|
5
|
+
|
6
|
+
### 2.6.4 (2023-07-11)
|
7
|
+
- [Improvement] Use original error `#inspect` for `WaterDrop::Errors::ProduceError` and `WaterDrop::Errors::ProduceManyError` instead of the current empty string.
|
8
|
+
|
3
9
|
### 2.6.3 (2023-06-28)
|
4
10
|
- [Change] Use `Concurrent::AtomicFixnum` to track operations in progress to prevent potential race conditions on JRuby and TruffleRuby (not yet supported but this is for future usage).
|
5
11
|
- [Change] Require `karafka-rdkafka` `>= 0.13.2`.
|
data/Gemfile.lock
CHANGED
data/lib/waterdrop/errors.rb
CHANGED
@@ -38,8 +38,9 @@ module WaterDrop
|
|
38
38
|
|
39
39
|
# @param dispatched [Array<Rdkafka::Producer::DeliveryHandle>] handlers of the
|
40
40
|
# messages that we've dispatched
|
41
|
-
|
42
|
-
|
41
|
+
# @param message [String] error message
|
42
|
+
def initialize(dispatched, message)
|
43
|
+
super(message)
|
43
44
|
@dispatched = dispatched
|
44
45
|
end
|
45
46
|
end
|
@@ -22,18 +22,22 @@ module WaterDrop
|
|
22
22
|
producer_id: id,
|
23
23
|
message: message
|
24
24
|
) { produce(message) }
|
25
|
-
rescue *SUPPORTED_FLOW_ERRORS
|
26
|
-
|
25
|
+
rescue *SUPPORTED_FLOW_ERRORS => e
|
26
|
+
# We use this syntax here because we want to preserve the original `#cause` when we
|
27
|
+
# instrument the error and there is no way to manually assign `#cause` value
|
28
|
+
begin
|
29
|
+
raise Errors::ProduceError, e.inspect
|
30
|
+
rescue Errors::ProduceError => ex
|
31
|
+
@monitor.instrument(
|
32
|
+
'error.occurred',
|
33
|
+
producer_id: id,
|
34
|
+
message: message,
|
35
|
+
error: ex,
|
36
|
+
type: 'message.produce_async'
|
37
|
+
)
|
27
38
|
|
28
|
-
|
29
|
-
|
30
|
-
producer_id: id,
|
31
|
-
message: message,
|
32
|
-
error: re_raised,
|
33
|
-
type: 'message.produce_async'
|
34
|
-
)
|
35
|
-
|
36
|
-
raise re_raised
|
39
|
+
raise ex
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
# Produces many messages to Kafka and does not wait for them to be delivered
|
@@ -62,8 +66,8 @@ module WaterDrop
|
|
62
66
|
|
63
67
|
dispatched
|
64
68
|
end
|
65
|
-
rescue *SUPPORTED_FLOW_ERRORS
|
66
|
-
re_raised = Errors::ProduceManyError.new(dispatched)
|
69
|
+
rescue *SUPPORTED_FLOW_ERRORS => e
|
70
|
+
re_raised = Errors::ProduceManyError.new(dispatched, e.inspect)
|
67
71
|
|
68
72
|
@monitor.instrument(
|
69
73
|
'error.occurred',
|
@@ -26,18 +26,22 @@ module WaterDrop
|
|
26
26
|
) do
|
27
27
|
wait(produce(message))
|
28
28
|
end
|
29
|
-
rescue *SUPPORTED_FLOW_ERRORS
|
30
|
-
|
29
|
+
rescue *SUPPORTED_FLOW_ERRORS => e
|
30
|
+
# We use this syntax here because we want to preserve the original `#cause` when we
|
31
|
+
# instrument the error and there is no way to manually assign `#cause` value
|
32
|
+
begin
|
33
|
+
raise Errors::ProduceError, e.inspect
|
34
|
+
rescue Errors::ProduceError => ex
|
35
|
+
@monitor.instrument(
|
36
|
+
'error.occurred',
|
37
|
+
producer_id: id,
|
38
|
+
message: message,
|
39
|
+
error: ex,
|
40
|
+
type: 'message.produce_sync'
|
41
|
+
)
|
31
42
|
|
32
|
-
|
33
|
-
|
34
|
-
producer_id: id,
|
35
|
-
message: message,
|
36
|
-
error: re_raised,
|
37
|
-
type: 'message.produce_sync'
|
38
|
-
)
|
39
|
-
|
40
|
-
raise re_raised
|
43
|
+
raise ex
|
44
|
+
end
|
41
45
|
end
|
42
46
|
|
43
47
|
# Produces many messages to Kafka and waits for them to be delivered
|
@@ -69,8 +73,8 @@ module WaterDrop
|
|
69
73
|
|
70
74
|
dispatched
|
71
75
|
end
|
72
|
-
rescue *SUPPORTED_FLOW_ERRORS
|
73
|
-
re_raised = Errors::ProduceManyError.new(dispatched)
|
76
|
+
rescue *SUPPORTED_FLOW_ERRORS => e
|
77
|
+
re_raised = Errors::ProduceManyError.new(dispatched, e.inspect)
|
74
78
|
|
75
79
|
@monitor.instrument(
|
76
80
|
'error.occurred',
|
data/lib/waterdrop/producer.rb
CHANGED
@@ -228,7 +228,7 @@ module WaterDrop
|
|
228
228
|
# the original cause to maintain the same API across all the errors dispatched to the
|
229
229
|
# notifications pipeline.
|
230
230
|
begin
|
231
|
-
raise Errors::ProduceError
|
231
|
+
raise Errors::ProduceError, e.inspect
|
232
232
|
rescue Errors::ProduceError => e
|
233
233
|
# We want to instrument on this event even when we restart it.
|
234
234
|
# The reason is simple: instrumentation and visibility.
|
data/lib/waterdrop/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waterdrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
|
36
36
|
MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2023-
|
38
|
+
date: 2023-07-22 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: karafka-core
|
metadata.gz.sig
CHANGED
Binary file
|