rdkafka 0.29.1-x86_64-linux-gnu → 0.30.0-x86_64-linux-gnu

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b202c3af775d40f6a22c3d6c382c00fa6291408fe14f2e7757c363e8eb9cd66e
4
- data.tar.gz: d44d891938c492d18288f262ff1ee44aa6ced84e10a35faf03019db39e866365
3
+ metadata.gz: 6cbfeca6691c80f07daca6112fe239af1eae0304a00908b3378dffb91a2f01ec
4
+ data.tar.gz: 901de6eead3a8185ec4e296bd5a84533150ea9b5e9bc1a058a05a5e61af8cc82
5
5
  SHA512:
6
- metadata.gz: 681b3fa9ec68bf837f6279b83a24dc74de9e724f620063e26a4ad92f7eeea384d131236d73059e182d24641faaeb145586c915a0690a204c9b892a04b768f4d1
7
- data.tar.gz: 69d82527c4d0794f67cffd2e03196430c0195dfd852f9b9791f4e16dfc4c5db876c5bcbf10369afcfbe80fd418102b760c8991436182048be8fb091b85ad960b
6
+ metadata.gz: e2288ca3c7a61c91ad2629a27008a91bbe882fa65dd3d2c3fb0f81e5ac8c2d90d7c598cf85dbd0ec2d715f644f0daecfa59b79c6c7d469f957a0f15ed054a7fc
7
+ data.tar.gz: 2f804fd56523de51e25ad733c2d5b3848af10942bb5f3d75b15e88428e2ecd119b2436f8a7971f3deaa49146923b528a4bb2c4785be7f9b1ff6c2cc582c33c3b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Rdkafka Changelog
2
2
 
3
+ ## 0.30.0 (2026-09-25)
4
+ - [Feature] Add `Admin#alter_consumer_group_offsets` and `Admin#delete_consumer_group_offsets` to set or clear a consumer group's committed offsets from the admin client.
5
+ - [Enhancement] Bump the bundled zlib to `1.3.2`.
6
+ - [Enhancement] Bump librdkafka to `2.15.0`.
7
+ - [Enhancement] Bump the bundled MIT Kerberos (krb5) to `1.22.2`.
8
+ - [Enhancement] Add `Rdkafka::Config.partitioner_key_uses_bytesize` to hash partition keys by byte length, matching other Kafka clients for multibyte keys. Defaults to `false`.
9
+ - [Maintenance] Derive the zlib `CHECKSUMS` entry from `ZLIB_VERSION`.
10
+ - [Maintenance] Drop the unused `dist/openssl-3.0.16.tar.gz` build cache.
11
+ - [Fix] Honor the `isolation_level:` argument to `Admin#list_offsets`, which was silently ignored.
12
+ - [Fix] Return correct results for every item of a multi-item topic, partition, group or ACL admin request, not just the first.
13
+ - [Maintenance] Fix a use-after-free in the multi-item admin integration test that read result-name pointers after librdkafka had destroyed the background event, which made it flaky on newer glibc (e.g. Debian trixie).
14
+ - [Maintenance] Stabilize consumer specs on slow CI runners: wait longer for a partition assignment, raise the `TestTopics.create` admin timeout (a timeout there also tripped the leaked-handle guard), and let the long-running consumption spec drain its backlog instead of stopping at a fixed 60s.
15
+ - [Maintenance] Raise the `TestTopics.create` admin timeout to 30s so a loaded CI runner no longer hits `create topic timed out` (which also tripped the leaked-handle guard).
16
+
17
+ ## 0.29.2 (2026-09-11)
18
+ - [Fix] Close live clients from an `at_exit` hook before Ruby's shutdown finalization, so librdkafka is no longer `dlclose`d while its native threads are still running (which could segfault on exit).
19
+ - [Fix] Make client construction exception-safe and destroy the native handle when setup fails after `rd_kafka_new`, so a later error no longer orphans the native client.
20
+ - [Fix] Fix a double-free in `Consumer#poll_batch`/`#poll_batch_nb` that could abort the process when building a message raised a non-`RdkafkaError`.
21
+ - [Fix] Free native resources when `Admin#describe_configs`/`#incremental_alter_configs` raise while building their request (e.g. a non-String resource name).
22
+ - [Fix] Raise `ConfigError` instead of segfaulting when `Admin#describe_configs`/`#incremental_alter_configs` get an empty resource name or a negative resource type.
23
+
3
24
  ## 0.29.1 (2026-09-04)
4
25
  - [Enhancement] Add `Admin#delete_records` to delete all messages in a partition up to a given offset.
5
26
  - [Enhancement] Add `Admin#list_consumer_groups` to list the cluster's consumer groups.
@@ -8,11 +29,12 @@
8
29
  - [Fix] Make `NativeKafka#close` fork-aware so a forked child no longer segfaults on exit.
9
30
  - [Fix] Stabilize the `to_native_tpl` leak integration spec.
10
31
  - [Fix] Stabilize the flaky partitions count cache statistics spec.
32
+ - [Fix] Use global allocator in topic_partition_list for pointer freed by librdkafka.
11
33
 
12
34
  ## 0.29.0 (2026-07-10)
13
35
  - [Enhancement] Bump librdkafka to `2.14.2`
14
- - [Enhancement] Add `Consumer#metadata` and `Producer#metadata`, mirroring `Admin#metadata`, so cluster/topic metadata can be fetched from an existing consumer or producer handle without opening a dedicated admin connection.
15
- - [Enhancement] Support offset-commit metadata: `Consumer#store_offset(message, metadata)` stores an optional metadata string alongside the offset, `Consumer::Partition#metadata` exposes it, and `TopicPartitionList` marshals it to and from the native list (read back via `Consumer#committed`).
36
+ - [Enhancement] Add `Consumer#metadata` and `Producer#metadata`, mirroring `Admin#metadata`, to fetch cluster metadata without a separate admin connection.
37
+ - [Enhancement] Support offset-commit metadata via `Consumer#store_offset(message, metadata)`, readable through `Consumer::Partition#metadata` and `Consumer#committed`.
16
38
  - [Enhancement] Expose `replicas` and `isrs` (in-sync replica broker ids) on each partition in topic metadata; both were previously dropped from the `Metadata#topics` partition hashes.
17
39
  - [Enhancement] Extract the admin background-event result handlers into one class per operation under `lib/rdkafka/callbacks/`. Internal reorganization with no API or behavior change.
18
40
  - [Enhancement] Reuse per-thread scratch pointers in `Consumer::Headers.from_native`, removing the per-message native allocations from the consumer hot path.
@@ -20,32 +42,32 @@
20
42
  - [Fix] Cache the partition count for a missing topic, so `produce` with a `partition_key` to a missing topic no longer re-runs a blocking metadata query on every message.
21
43
  - [Fix] Let `PartitionsCountCache` adopt a lower partition count once the cached entry has expired, so a topic recreated with fewer partitions no longer fails `produce` until process restart.
22
44
  - [Fix] Surface per-message build errors inline in `Consumer#poll_batch`/`#poll_batch_nb` instead of discarding the batch, preserving the messages that built successfully.
23
- - [Fix] Bound the `Metadata` retry loop by a ~5s wall-clock budget with a floor of 3 attempts, cap the backoff at 1s, and stop overwriting the request timeout with the backoff value, which could block a synchronous fetch for minutes.
45
+ - [Fix] Bound the `Metadata` retry loop to about 5 seconds, so a synchronous metadata fetch can no longer block for minutes.
24
46
  - [Fix] Synchronize `AbstractHandle::REGISTRY` mutations with a mutex, which could otherwise lose a write on JRuby and leave a handle unregistered or leaked.
25
- - [Fix] Fix the NULL background-queue cleanup branches in `Admin#delete_group`, `Admin#delete_acl` and `Admin#describe_acl`, which raised a `NameError` and leaked the native request object instead of raising `ConfigError`.
47
+ - [Fix] Raise `ConfigError` instead of `NameError` in `Admin#delete_group`, `#delete_acl` and `#describe_acl` when the background queue is unavailable.
26
48
  - [Fix] Actually populate `ConfigBindingResult#synonyms`. The synonym loop built the synonym binding objects and discarded them, so `#synonyms` was always an empty array; they are now appended.
27
49
  - [Fix] Stop leaking the native `rd_kafka_topic_conf_t` in `Producer#set_topic_config` when a per-topic config value is rejected.
28
- - [Fix] Add the missing `closed_consumer_check` to `Consumer#position`, the only public consumer method without one; calling it on a closed consumer now raises a consistent `ClosedConsumerError` instead of failing deeper in the call.
50
+ - [Fix] Raise `ClosedConsumerError` from `Consumer#position` on a closed consumer, like the other consumer methods.
29
51
  - [Fix] Guard the OAuthBearer token refresh callback against a NULL client pointer before calling `rd_kafka_name` on it.
30
- - [Fix] Make the `Consumer` GC finalizer close the consumer and destroy its consumer queue, not just the native client, preventing a hang or leak when a consumer is collected without an explicit `close`.
52
+ - [Fix] Fully close a consumer collected without an explicit `close`, preventing a hang or leak.
31
53
  - [Fix] Free the librdkafka-allocated string in `Consumer#cluster_id` and `Consumer#member_id`, and fix the `rd_kafka_clusterid` arity. `Consumer#cluster_id` now accepts a `timeout_ms`.
32
54
  - [Fix] Attach `rd_kafka_query_watermark_offsets` with `blocking: true` so it releases the GVL; it previously froze every other Ruby thread for up to `timeout_ms`.
33
55
  - [Fix] Stop leaking the native `rd_kafka_conf_t` when client creation fails, a multi-KB leak per failed attempt for supervisors retrying on transient SASL/SSL misconfiguration.
34
56
  - [Fix] Stop `Metadata` from leaking the native metadata struct on every retried fetch; each attempt now frees its own native resources.
35
57
  - [Fix] Stop `Producer#produce` from orphaning the delivery handle in the process-global registry when it fails after registering it.
36
58
  - [Fix] Guard the message delivery callback so a raising user `delivery_callback` can no longer leave the handle locked or crash the producer; exceptions are now logged and swallowed.
37
- - [Fix] Stop `describe_configs`, `incremental_alter_configs` and `list_offsets` from leaking handles and native resources when their arguments are rejected; all three now validate input before allocating.
38
- - [Fix] Destroy the native topic-partition list in `TopicPartitionList#to_native_tpl` when population fails partway (e.g. an invalid partition). The caller-owned list was leaked on any exception mid-build; it is now destroyed before the error propagates.
59
+ - [Fix] Stop `describe_configs`, `incremental_alter_configs` and `list_offsets` from leaking native resources when their arguments are rejected.
60
+ - [Fix] Stop `TopicPartitionList#to_native_tpl` from leaking the native list when building it fails partway.
39
61
  - [Fix] Raise instead of silently dropping a rejected `incremental_alter_configs` entry, which previously left the alter request reporting success.
40
62
  - [Fix] Allocate the admin result-count out-parameter as `:size_t` instead of `:int32`, fixing a 4-byte overflow on every admin result parse.
41
63
  - [Fix] Stabilize the flaky `Consumer#lag` "calculates the consumer lag" spec on overloaded CI.
42
- - [Fix] Resolve admin operation handles from the event error when an operation fails at the operation level (e.g. brokers unreachable), instead of blocking until `wait` timed out and discarding the real error.
43
- - [Fix] Destroy admin API background events after processing; they were never destroyed, so every admin operation leaked its whole result event. The internal FFI struct fields on admin handles were removed as part of this - use `handle.wait` and the returned report objects, whose interfaces are unchanged.
64
+ - [Fix] Return the real error from an admin operation that fails at the operation level (e.g. brokers unreachable) instead of blocking until `wait` times out.
65
+ - [Fix] Stop every admin operation from leaking its result event. The internal FFI struct fields on admin handles are removed; use `handle.wait` and the returned report objects, which are unchanged.
44
66
 
45
67
  ## 0.28.0 (2026-06-03)
46
68
  - [Enhancement] Bump librdkafka to `2.14.1`
47
69
  - [Enhancement] Replace version-gated `Warning[:performance]` with dynamic `Warning.categories` opt-in in spec helper so new Ruby warning categories are automatically enabled without manual updates.
48
- - [Enhancement] `poll_batch` and `poll_batch_nb` now return error events inline as `RdkafkaError` objects rather than raising on the first error. The return type is `Array<Message, RdkafkaError>` and callers are responsible for handling errors in the result.
70
+ - [Enhancement] `poll_batch` and `poll_batch_nb` now return errors inline as `RdkafkaError` objects instead of raising on the first one. The return type is `Array<Message, RdkafkaError>`, so callers must handle errors in the result.
49
71
 
50
72
  ## 0.27.0 (2026-05-07)
51
73
  - [Feature] Add `Consumer#poll_batch(timeout_ms, max_items:)` and `Consumer#poll_batch_nb(timeout_ms, max_items:)` for batch message polling via `rd_kafka_consume_batch_queue`.
data/README.md CHANGED
@@ -163,6 +163,7 @@ bundle exec rake produce_messages
163
163
 
164
164
  | rdkafka-ruby | librdkafka | patches |
165
165
  |-|-|-|
166
+ | 0.30.x (2026-09-25) | 2.15.0 (2026-06-30) | yes |
166
167
  | 0.29.x (2026-07-10) | 2.14.2 (2026-06-03) | yes |
167
168
  | 0.28.x (2026-06-03) | 2.14.1 (2026-04-15) | yes |
168
169
  | 0.27.x (2026-05-07) | 2.14.0 (2026-04-01) | yes |
data/ext/librdkafka.so CHANGED
Binary file
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rdkafka
4
+ class Admin
5
+ # Handle for alter consumer group offsets operation
6
+ class AlterConsumerGroupOffsetsHandle < AbstractHandle
7
+ layout :pending, :bool,
8
+ :response, :int
9
+
10
+ # @return [String] the name of the operation
11
+ def operation_name
12
+ "alter consumer group offsets"
13
+ end
14
+
15
+ # Creates the result report
16
+ # @return [AlterConsumerGroupOffsetsReport]
17
+ def create_result
18
+ prepared_result
19
+ end
20
+
21
+ # Raises an error if the operation failed
22
+ # @raise [RdkafkaError]
23
+ def raise_error
24
+ raise RdkafkaError.new(
25
+ self[:response],
26
+ broker_message: broker_message
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rdkafka
4
+ class Admin
5
+ # Report for alter consumer group offsets operation result
6
+ class AlterConsumerGroupOffsetsReport
7
+ # @return [String, nil] the group the operation ran against
8
+ attr_reader :group_name
9
+
10
+ # @return [String, nil] group level error message, if any
11
+ attr_reader :error_string
12
+
13
+ # Per partition outcomes, each with `:topic`, `:partition`, `:offset` and `:error`
14
+ # (an `RdkafkaError` or nil). Partitions are reported individually because Kafka can
15
+ # fail some and accept others within a single request.
16
+ # @return [Array<Hash>]
17
+ attr_reader :partitions
18
+
19
+ # @param error_string [FFI::Pointer] pointer to the group level error string
20
+ # @param result_name [FFI::Pointer] pointer to the group name
21
+ # @param partitions_ptr [FFI::Pointer] pointer to the per partition result list
22
+ def initialize(error_string, result_name, partitions_ptr = FFI::Pointer::NULL)
23
+ @error_string = error_string.read_string if error_string != FFI::Pointer::NULL
24
+ @group_name = result_name.read_string if result_name != FFI::Pointer::NULL
25
+ @partitions = extract_partitions(partitions_ptr)
26
+ end
27
+
28
+ private
29
+
30
+ # @param partitions_ptr [FFI::Pointer] pointer to a native topic partition list
31
+ # @return [Array<Hash>]
32
+ def extract_partitions(partitions_ptr)
33
+ return [] if partitions_ptr.nil? || partitions_ptr.null?
34
+
35
+ native = Bindings::TopicPartitionList.new(partitions_ptr)
36
+
37
+ Array.new(native[:cnt]) do |i|
38
+ tp = Bindings::TopicPartition.new(native[:elems] + (i * Bindings::TopicPartition.size))
39
+
40
+ {
41
+ topic: tp[:topic],
42
+ partition: tp[:partition],
43
+ offset: tp[:offset],
44
+ error: tp[:err].zero? ? nil : RdkafkaError.new(tp[:err])
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rdkafka
4
+ class Admin
5
+ # Handle for delete consumer group offsets operation
6
+ class DeleteConsumerGroupOffsetsHandle < AbstractHandle
7
+ layout :pending, :bool,
8
+ :response, :int
9
+
10
+ # @return [String] the name of the operation
11
+ def operation_name
12
+ "delete consumer group offsets"
13
+ end
14
+
15
+ # Creates the result report
16
+ # @return [DeleteConsumerGroupOffsetsReport]
17
+ def create_result
18
+ prepared_result
19
+ end
20
+
21
+ # Raises an error if the operation failed
22
+ # @raise [RdkafkaError]
23
+ def raise_error
24
+ raise RdkafkaError.new(
25
+ self[:response],
26
+ broker_message: broker_message
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rdkafka
4
+ class Admin
5
+ # Report for delete consumer group offsets operation result
6
+ class DeleteConsumerGroupOffsetsReport
7
+ # @return [String, nil] the group the operation ran against
8
+ attr_reader :group_name
9
+
10
+ # @return [String, nil] group level error message, if any
11
+ attr_reader :error_string
12
+
13
+ # Per partition outcomes, each with `:topic`, `:partition`, `:offset` and `:error`
14
+ # (an `RdkafkaError` or nil). Partitions are reported individually because Kafka can
15
+ # fail some and accept others within a single request.
16
+ # @return [Array<Hash>]
17
+ attr_reader :partitions
18
+
19
+ # @param error_string [FFI::Pointer] pointer to the group level error string
20
+ # @param result_name [FFI::Pointer] pointer to the group name
21
+ # @param partitions_ptr [FFI::Pointer] pointer to the per partition result list
22
+ def initialize(error_string, result_name, partitions_ptr = FFI::Pointer::NULL)
23
+ @error_string = error_string.read_string if error_string != FFI::Pointer::NULL
24
+ @group_name = result_name.read_string if result_name != FFI::Pointer::NULL
25
+ @partitions = extract_partitions(partitions_ptr)
26
+ end
27
+
28
+ private
29
+
30
+ # @param partitions_ptr [FFI::Pointer] pointer to a native topic partition list
31
+ # @return [Array<Hash>]
32
+ def extract_partitions(partitions_ptr)
33
+ return [] if partitions_ptr.nil? || partitions_ptr.null?
34
+
35
+ native = Bindings::TopicPartitionList.new(partitions_ptr)
36
+
37
+ Array.new(native[:cnt]) do |i|
38
+ tp = Bindings::TopicPartition.new(native[:elems] + (i * Bindings::TopicPartition.size))
39
+
40
+ {
41
+ topic: tp[:topic],
42
+ partition: tp[:partition],
43
+ offset: tp[:offset],
44
+ error: tp[:err].zero? ? nil : RdkafkaError.new(tp[:err])
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end