waterdrop 2.6.8 → 2.6.9
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/waterdrop/config.rb +3 -2
- data/lib/waterdrop/instrumentation/logger_listener.rb +5 -0
- data/lib/waterdrop/instrumentation/notifications.rb +1 -0
- data/lib/waterdrop/producer/transactions.rb +8 -3
- 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: a4811e6ec1f3cbea82e4604e95b9cd3deddce9337e9fd935f786bd97d008e914
|
4
|
+
data.tar.gz: baf54ded0ca2e0ec90e659c199138a36932cd5e2f8d6afffbfdb6b770ebbd29c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b2b33cfd43d78ae534c14780accb6193a6ec6ff930168c7c7e2813eb9e2599702c2db923b05793a7366f236e9d51250b07894c7cb11b8f1eca81cb79bafa3b7
|
7
|
+
data.tar.gz: bde20c38e6ebbac05db6085381928516c050512adffd9a4a36a14c80edfed9788b8375edc1e058f38d809cf7862d742f4116fe94efca6fddc5bb0242d4ba216f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# WaterDrop changelog
|
2
2
|
|
3
|
+
## 2.6.9 (2023-10-23)
|
4
|
+
- [Improvement] Introduce a `transaction.finished` event to indicate that transaction has finished whether it was aborted or committed.
|
5
|
+
- [Improvement] Use `transaction.committed` event to indicate that transaction has been committed.
|
6
|
+
|
3
7
|
## 2.6.8 (2023-10-20)
|
4
8
|
- **[Feature]** Introduce transactions support.
|
5
9
|
- [Improvement] Expand `LoggerListener` to inform about transactions (info level).
|
data/Gemfile.lock
CHANGED
data/lib/waterdrop/config.rb
CHANGED
@@ -64,9 +64,10 @@ module WaterDrop
|
|
64
64
|
# option [Numeric] how many seconds should we wait with the backoff on queue having space for
|
65
65
|
# more messages before re-raising the error.
|
66
66
|
setting :wait_timeout_on_queue_full, default: 10
|
67
|
-
|
67
|
+
# option [Numeric] How long to wait before retrying a retryable transaction related error
|
68
68
|
setting :wait_backoff_on_transaction_command, default: 0.5
|
69
|
-
|
69
|
+
# option [Numeric] How many times to retry a retryable transaction related error before
|
70
|
+
# giving up
|
70
71
|
setting :max_attempts_on_transaction_command, default: 5
|
71
72
|
|
72
73
|
# option [Boolean] should we send messages. Setting this to false can be really useful when
|
@@ -145,6 +145,11 @@ module WaterDrop
|
|
145
145
|
info(event, 'Committing transaction')
|
146
146
|
end
|
147
147
|
|
148
|
+
# @param event [Dry::Events::Event] event that happened with the details
|
149
|
+
def on_transaction_finished(event)
|
150
|
+
info(event, 'Processing transaction')
|
151
|
+
end
|
152
|
+
|
148
153
|
private
|
149
154
|
|
150
155
|
# @return [Boolean] should we report the messages details in the debug mode.
|
@@ -49,7 +49,7 @@ module WaterDrop
|
|
49
49
|
return yield if @transaction_mutex.owned?
|
50
50
|
|
51
51
|
@transaction_mutex.synchronize do
|
52
|
-
transactional_instrument(:
|
52
|
+
transactional_instrument(:finished) do
|
53
53
|
with_transactional_error_handling(:begin) do
|
54
54
|
transactional_instrument(:started) { client.begin_transaction }
|
55
55
|
end
|
@@ -65,11 +65,16 @@ module WaterDrop
|
|
65
65
|
commit || raise(WaterDrop::Errors::AbortTransaction)
|
66
66
|
|
67
67
|
with_transactional_error_handling(:commit) do
|
68
|
-
client.commit_transaction
|
68
|
+
transactional_instrument(:committed) { client.commit_transaction }
|
69
69
|
end
|
70
70
|
|
71
71
|
result
|
72
|
-
|
72
|
+
# We need to handle any interrupt including critical in order not to have the transaction
|
73
|
+
# running. This will also handle things like `IRB::Abort`
|
74
|
+
#
|
75
|
+
# rubocop:disable Lint/RescueException
|
76
|
+
rescue Exception => e
|
77
|
+
# rubocop:enable Lint/RescueException
|
73
78
|
with_transactional_error_handling(:abort) do
|
74
79
|
transactional_instrument(:aborted) { client.abort_transaction }
|
75
80
|
end
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
|
36
36
|
msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2023-10-
|
38
|
+
date: 2023-10-23 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
|