karafka 2.2.10 → 2.2.11

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: 460029e2dbc352c56f107e18bbff28f5914b5b56a0e42be9670e13f0f3592fc9
4
- data.tar.gz: 68c25bacd1995a8e9c97a915e1e1b2b4435437c97a5e31e2824499c9ad531057
3
+ metadata.gz: '08439276b10ee121dabe7ef6496334d7aef3cf6a8a49fdc723e6333a147d57d7'
4
+ data.tar.gz: f1022962556a4e3397ec256bdd63e7ced077cadabddf72849473eef8ec190186
5
5
  SHA512:
6
- metadata.gz: adc877c3be3cb8885b0244168014387f0353bed89575b6931f5e1ca062d01ba6a0e5a0566da4dd282f5117c7daf27ff2116f27025ec4213972c1ca52e92980de
7
- data.tar.gz: a62ff96ef96ea85d98288bad3c8f6cf0bfafc1ee6de1cf928fe803ad80435b0fa137aac9cf5eff4b232e854b3c4df76c3c16efaa4a117d6b86e442975cfc9a30
6
+ metadata.gz: 75f6a68aba0fa013bcdbcd618c9186f5b2e8870723aaef87bbfb8cb745c4a33862efac55c2a46938b7ad843f1f5e6640ebe381861c4365f459df8f115288cf2d
7
+ data.tar.gz: 6e495a3376f1c9650039534260c3d21ea697b77104ad2b9d7393b1ae8301cc29a116a6757efb9ead13716932ec7f6b188ab2404f3f0d86a68942f2c9972a5dc6
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 2.2.11 (2023-11-03)
4
+ - [Improvement] Allow marking as consumed in the user `#synchronize` block.
5
+ - [Improvement] Make whole Pro VP marking as consumed concurrency safe for both async and sync scenarios.
6
+ - [Improvement] Provide new alias to `karafka server`, that is: `karafka consumer`.
7
+
3
8
  ## 2.2.10 (2023-11-02)
4
9
  - [Improvement] Allow for running `#pause` without specifying the offset (provide offset or `:consecutive`). This allows for pausing on the consecutive message (last received + 1), so after resume we will get last message received + 1 effectively not using `#seek` and not purging `librdafka` buffer preserving on networking. Please be mindful that this uses notion of last message passed from **librdkafka**, and not the last one available in the consumer (`messages.last`). While for regular cases they will be the same, when using things like DLQ, LRJs, VPs or Filtering API, those may not be the same.
5
10
  - [Improvement] **Drastically** improve network efficiency of operating with LRJ by using the `:consecutive` offset as default strategy for running LRJs without moving the offset in place and purging the data.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.2.10)
5
- karafka-core (>= 2.2.2, < 2.3.0)
4
+ karafka (2.2.11)
5
+ karafka-core (>= 2.2.6, < 2.3.0)
6
6
  waterdrop (>= 2.6.10, < 3.0.0)
7
7
  zeitwerk (~> 2.3)
8
8
 
@@ -39,7 +39,7 @@ GEM
39
39
  activesupport (>= 6.1)
40
40
  i18n (1.14.1)
41
41
  concurrent-ruby (~> 1.0)
42
- karafka-core (2.2.5)
42
+ karafka-core (2.2.6)
43
43
  concurrent-ruby (>= 1.1)
44
44
  karafka-rdkafka (>= 0.13.8, < 0.15.0)
45
45
  karafka-rdkafka (0.13.8)
data/README.md CHANGED
@@ -59,8 +59,8 @@ We also maintain many [integration specs](https://github.com/karafka/karafka/tre
59
59
  1. Add and install Karafka:
60
60
 
61
61
  ```bash
62
- # Make sure to install Karafka 2.1
63
- bundle add karafka --version ">= 2.1.2"
62
+ # Make sure to install Karafka 2.2
63
+ bundle add karafka --version ">= 2.2.10"
64
64
 
65
65
  bundle exec karafka install
66
66
  ```
data/karafka.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  without having to focus on things that are not your business domain.
22
22
  DESC
23
23
 
24
- spec.add_dependency 'karafka-core', '>= 2.2.2', '< 2.3.0'
24
+ spec.add_dependency 'karafka-core', '>= 2.2.6', '< 2.3.0'
25
25
  spec.add_dependency 'waterdrop', '>= 2.6.10', '< 3.0.0'
26
26
  spec.add_dependency 'zeitwerk', '~> 2.3'
27
27
 
@@ -12,9 +12,9 @@ module Karafka
12
12
 
13
13
  private_constant :SUPPORTED_TYPES
14
14
 
15
- desc 'Starts the Karafka server (short-cut alias: "s")'
15
+ desc 'Starts the Karafka server (short-cut aliases: "s", "consumer")'
16
16
 
17
- aliases :s
17
+ aliases :s, :consumer
18
18
 
19
19
  option(
20
20
  :consumer_groups,
@@ -137,7 +137,15 @@ module Karafka
137
137
  def push_tags
138
138
  return unless Karafka.logger.respond_to?(:push_tags)
139
139
 
140
- Karafka.logger.push_tags(client.log_correlation)
140
+ # Older versions of ddtrace do not have the `#log_correlation` method, so we fallback
141
+ # to the older method for tags
142
+ tags = if client.respond_to?(:log_correlation)
143
+ client.log_correlation
144
+ else
145
+ client.active_correlation.to_s
146
+ end
147
+
148
+ Karafka.logger.push_tags(tags)
141
149
  end
142
150
 
143
151
  # Pops datadog's tags from the logger
@@ -47,9 +47,9 @@ module Karafka
47
47
  manager.mark_until(message) if coordinator.finished?
48
48
 
49
49
  return revoked? unless manager.markable?
50
- end
51
50
 
52
- manager.markable? ? super(manager.markable) : revoked?
51
+ manager.markable? ? super(manager.markable) : revoked?
52
+ end
53
53
  end
54
54
 
55
55
  # @param message [Karafka::Messages::Message] blocking marks message as consumed
@@ -61,9 +61,8 @@ module Karafka
61
61
  coordinator.synchronize do
62
62
  manager.mark(message)
63
63
  manager.mark_until(message) if coordinator.finished?
64
+ manager.markable? ? super(manager.markable) : revoked?
64
65
  end
65
-
66
- manager.markable? ? super(manager.markable) : revoked?
67
66
  end
68
67
 
69
68
  # @return [Boolean] is the virtual processing collapsed in the context of given
@@ -162,14 +162,19 @@ module Karafka
162
162
  @manual_seek
163
163
  end
164
164
 
165
- # Allows to run synchronized (locked) code that can operate in between virtual partitions
165
+ # Allows to run synchronized (locked) code that can operate only from a given thread
166
+ #
166
167
  # @param block [Proc] code we want to run in the synchronized mode
168
+ # @note We check if mutex is not owned already by the current thread so we won't end up with
169
+ # a deadlock in case user runs coordinated code from inside of his own lock
167
170
  def synchronize(&block)
168
- @mutex.synchronize(&block)
171
+ if @mutex.owned?
172
+ yield
173
+ else
174
+ @mutex.synchronize(&block)
175
+ end
169
176
  end
170
177
 
171
- private
172
-
173
178
  # @param consumer [Object] karafka consumer (normal or pro)
174
179
  # @return [Karafka::Processing::Result] result object which we can use to indicate
175
180
  # consumption processing state.
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.2.10'
6
+ VERSION = '2.2.11'
7
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.10
4
+ version: 2.2.11
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-11-02 00:00:00.000000000 Z
38
+ date: 2023-11-03 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka-core
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.2.2
46
+ version: 2.2.6
47
47
  - - "<"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 2.3.0
@@ -53,7 +53,7 @@ dependencies:
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 2.2.2
56
+ version: 2.2.6
57
57
  - - "<"
58
58
  - !ruby/object:Gem::Version
59
59
  version: 2.3.0
metadata.gz.sig CHANGED
Binary file