karafka 2.4.4 → 2.4.5

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: 1b7333a7812643bc128c721e411449dfd477adfa52968c7c291900e622cdcc04
4
- data.tar.gz: 7062798152f0d4e097e5c4fcd228798103a680441579bbc1918c8bf5a65ce98b
3
+ metadata.gz: fe76e139b2007e11b0cb9393bc94e2b5b9cad5dc40d69b5ad2bfa34a0555e2b8
4
+ data.tar.gz: e288c63648d17388f577a45b51267e30fceb4726def0a42c40a9133de27d93f8
5
5
  SHA512:
6
- metadata.gz: bd24bd450ac1cda02d18d7d487317139988b943ecc92c606cb713f13c819db044d6feae978873d26445e1ebf8d8823bedfd7efae58bc53c8213be9ef56a84c1d
7
- data.tar.gz: 0f2f4b50ea90cd76f6275e0cdc9eeada5e5cd30bf6c18a219209dfe4b717d90ef88d7c6b68797e9eb0615c83ba03ee738d41164014ce74aaf27970ef07ba5974
6
+ metadata.gz: b5e46439a216e66c728ceb74070832407d39b1ebe06d21c858f3e3a0e8e599df15b749318131aa82a5bc994e6dd7ed3094f44639e706a57231f031f0e52186b6
7
+ data.tar.gz: dc44b6a2f0e5d21bdcbe156f0cc94c324d586c74e9fb757454157ac014897fc3cbd683acb19e6397d668f67a9c68e97d683521f1ceecdbf338e24f3d497c688d
checksums.yaml.gz.sig CHANGED
Binary file
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.3
1
+ 3.3.4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 2.4.5 (2024-07-18)
4
+ - [Change] Inject `client.id` when building subscription group and not during the initial setup.
5
+ - [Fix] Mitigate `confluentinc/librdkafka/issues/4783` by injecting dynamic client id when using `cooperative-sticky` strategy.
6
+
7
+ ### Change Note
8
+
9
+ `client.id` is technically a low-importance value that should not (aside from this error) impact operations. This is why it is not considered a breaking change. This change may be reverted when the original issue is fixed in librdkafka.
10
+
3
11
  ## 2.4.4 (2024-07-04)
4
12
  - [Enhancement] Allow for offset storing from the Filtering API.
5
13
  - [Enhancement] Print more extensive error info on forceful shutdown.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.4.4)
4
+ karafka (2.4.5)
5
5
  base64 (~> 0.2)
6
6
  karafka-core (>= 2.4.3, < 2.5.0)
7
7
  waterdrop (>= 2.7.3, < 3.0.0)
data/docker-compose.yml CHANGED
@@ -3,7 +3,7 @@ version: '2'
3
3
  services:
4
4
  kafka:
5
5
  container_name: kafka
6
- image: confluentinc/cp-kafka:7.6.1
6
+ image: confluentinc/cp-kafka:7.6.2
7
7
 
8
8
  ports:
9
9
  - 9092:9092
@@ -121,8 +121,8 @@ module Karafka
121
121
  kafka = Setup::AttributesMap.consumer(@topics.first.kafka.dup)
122
122
 
123
123
  inject_group_instance_id(kafka)
124
+ inject_client_id(kafka)
124
125
 
125
- kafka[:'client.id'] ||= client_id
126
126
  kafka[:'group.id'] ||= @consumer_group.id
127
127
  kafka[:'auto.offset.reset'] ||= @topics.first.initial_offset
128
128
  # Karafka manages the offsets based on the processing state, thus we do not rely on the
@@ -132,6 +132,26 @@ module Karafka
132
132
  kafka
133
133
  end
134
134
 
135
+ # Sets (if needed) the client.id attribute
136
+ #
137
+ # @param kafka [Hash] kafka level config
138
+ def inject_client_id(kafka)
139
+ # If client id is set directly on librdkafka level, we do nothing and just go with what
140
+ # end user has configured
141
+ return if kafka.key?(:'client.id')
142
+
143
+ # This mitigates an issue for multiplexing and potentially other cases when running
144
+ # multiple karafka processes on one machine, where librdkafka goes into an infinite
145
+ # loop when using cooperative-sticky and upscaling.
146
+ #
147
+ # @see https://github.com/confluentinc/librdkafka/issues/4783
148
+ kafka[:'client.id'] = if kafka[:'partition.assignment.strategy'] == 'cooperative-sticky'
149
+ "#{client_id}/#{Time.now.to_f}/#{SecureRandom.hex[0..9]}"
150
+ else
151
+ client_id
152
+ end
153
+ end
154
+
135
155
  # If we use static group memberships, there can be a case, where same instance id would
136
156
  # be set on many subscription groups as the group instance id from Karafka perspective is
137
157
  # set per config. Each instance even if they are subscribed to different topics needs to
@@ -385,9 +385,6 @@ module Karafka
385
385
  config.kafka[key] = value
386
386
  end
387
387
 
388
- # Use Karafka client_id as kafka client id if not set
389
- config.kafka[:'client.id'] ||= config.client_id
390
-
391
388
  return if Karafka::App.env.production?
392
389
 
393
390
  KAFKA_DEV_DEFAULTS.each do |key, value|
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.4.4'
6
+ VERSION = '2.4.5'
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.4.4
4
+ version: 2.4.5
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: 2024-07-04 00:00:00.000000000 Z
38
+ date: 2024-07-18 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: base64
metadata.gz.sig CHANGED
Binary file