karafka-rdkafka 0.30.2 → 0.31.0
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
- data/CHANGELOG.md +43 -27
- data/README.md +1 -0
- data/dist/{librdkafka-2.15.1.tar.gz → librdkafka-2.16.0.tar.gz} +0 -0
- data/dist/patches/rdkafka_share_async_ack_sort.patch +18 -0
- data/dist/patches/rdkafka_share_unsubscribe_release.patch +567 -0
- data/docker-compose-ssl.yml +1 -0
- data/docker-compose.yml +1 -0
- data/karafka-rdkafka.gemspec +1 -1
- data/lib/rdkafka/admin/describe_cluster_handle.rb +31 -0
- data/lib/rdkafka/admin/describe_cluster_report.rb +48 -0
- data/lib/rdkafka/admin/describe_consumer_groups_handle.rb +31 -0
- data/lib/rdkafka/admin/describe_consumer_groups_report.rb +151 -0
- data/lib/rdkafka/admin/describe_result_parsing.rb +47 -0
- data/lib/rdkafka/admin/describe_topics_handle.rb +31 -0
- data/lib/rdkafka/admin/describe_topics_report.rb +118 -0
- data/lib/rdkafka/admin.rb +245 -0
- data/lib/rdkafka/bindings/admin/acls.rb +85 -0
- data/lib/rdkafka/bindings/admin/configs.rb +37 -0
- data/lib/rdkafka/bindings/admin/list_offsets.rb +26 -0
- data/lib/rdkafka/bindings/admin.rb +197 -0
- data/lib/rdkafka/bindings/callbacks.rb +148 -0
- data/lib/rdkafka/bindings/configuration.rb +50 -0
- data/lib/rdkafka/bindings/consumer.rb +83 -0
- data/lib/rdkafka/bindings/errors.rb +17 -0
- data/lib/rdkafka/bindings/handle.rb +16 -0
- data/lib/rdkafka/bindings/messages.rb +28 -0
- data/lib/rdkafka/bindings/metadata.rb +17 -0
- data/lib/rdkafka/bindings/polling.rb +17 -0
- data/lib/rdkafka/bindings/producer.rb +82 -0
- data/lib/rdkafka/bindings/share_consumer.rb +67 -0
- data/lib/rdkafka/bindings/structs.rb +62 -0
- data/lib/rdkafka/bindings.rb +13 -775
- data/lib/rdkafka/callbacks/describe_cluster_handler.rb +36 -0
- data/lib/rdkafka/callbacks/describe_consumer_groups_handler.rb +36 -0
- data/lib/rdkafka/callbacks/describe_topics_handler.rb +36 -0
- data/lib/rdkafka/callbacks.rb +10 -1
- data/lib/rdkafka/clients.rb +13 -46
- data/lib/rdkafka/consumer/message.rb +6 -9
- data/lib/rdkafka/producer/delivery_handle.rb +18 -16
- data/lib/rdkafka/producer/delivery_report.rb +51 -1
- data/lib/rdkafka/share_consumer.rb +6 -0
- data/lib/rdkafka/version.rb +3 -3
- data/lib/rdkafka.rb +10 -0
- data/package-lock.json +9 -9
- metadata +30 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3cc16aee9b7a231693c92bb5abb3643a3c2d9ab47e557e46f095762306e0bb9f
|
|
4
|
+
data.tar.gz: dce5a57fab075eea90085314d5d84fcbc7c67e3d745e5ef465c5671be7302087
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b2923a1fab3ea8f16837a19128676c5690db0cf591fee5ca90f52a53b3dcd1b1f82ae59458f33a2ef2e40644b4760b53d82bc08e6bb3ece660a15764aba69ec
|
|
7
|
+
data.tar.gz: 94e99229a623f5e29100b28c8ccb6b34832b484ea11665fb93fc3b73cccc3b66515fc3638678e79216379eea1b9f383cf2e394098283ea87c24fe8f26e1a3ad8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,49 @@
|
|
|
1
1
|
# Rdkafka Changelog
|
|
2
2
|
|
|
3
|
+
## 0.31.0 (2026-10-12)
|
|
4
|
+
- [Feature] Add `Admin#describe_cluster` to get the cluster id, controller and broker nodes (with racks) without a full metadata request. Ported from rdkafka-ruby (#1015).
|
|
5
|
+
- [Feature] Add `Admin#describe_topics` to get topic ids, partition leaders and replicas, and per-topic errors. Both methods can also return the operations the client is authorized to perform. Ported from rdkafka-ruby (#1015).
|
|
6
|
+
- [Feature] Add `Admin#describe_consumer_groups` to read the state, type, coordinator, authorized operations and members (with their current and target partition assignments) of consumer groups. Ported from rdkafka-ruby (#1016).
|
|
7
|
+
- [Feature] Add `status`, `latency` and `broker_id` to `Producer::DeliveryReport`, with `#persisted?`, `#possibly_persisted?` and `#not_persisted?`, so a failed delivery tells whether a retry may duplicate the message. Ported from rdkafka-ruby (#1019).
|
|
8
|
+
- [Enhancement] Bump librdkafka to `2.16.0` for OpenSSL and libcurl security fixes. Admin requests in flight on a decommissioned broker now fail with a retryable transport error. Ported from rdkafka-ruby (#1020).
|
|
9
|
+
- [Enhancement] Bump the bundled OpenSSL to `3.5.9` (LTS) for its security fixes. Ported from rdkafka-ruby (#1007).
|
|
10
|
+
- [Enhancement] Read each pointer field once in `Message#initialize`, saving 3 allocations per consumed message. Ported from rdkafka-ruby (#1026).
|
|
11
|
+
- [Change] Drop Ruby 3.2 support; require Ruby 3.3+.
|
|
12
|
+
- [Change] Build the precompiled `aarch64-linux-musl` gem on Alpine `3.24` (was `3.23`), matching `x86_64-linux-musl`. Ported from rdkafka-ruby (#1012).
|
|
13
|
+
- [Change] Build the precompiled `macos_arm64` library on macOS 26 with the minimum macOS pinned to 14.0, instead of inheriting it from the build host. Ported from rdkafka-ruby (#1013).
|
|
14
|
+
- [Maintenance] Split `lib/rdkafka/bindings.rb` into per-area files under `lib/rdkafka/bindings/`. `Rdkafka::Bindings` is unchanged. Ported from rdkafka-ruby (#1022).
|
|
15
|
+
- [Maintenance] Stabilize the flaky partitions count cache "multiple topics with different TTLs" spec by driving its clock instead of sleeping. Ported from rdkafka-ruby (#1028).
|
|
16
|
+
- [Fix] Sort merged share-group async acknowledgements so the broker does not reject them with `invalid_request` (librdkafka patch).
|
|
17
|
+
- [Fix] Release share records acquired by an in-flight fetch on unsubscribe instead of keeping them locked (librdkafka patch). `ShareConsumer#unsubscribe` now closes the share sessions like `#close` does and waits for that (up to `fetch.wait.max.ms` with a fetch in flight).
|
|
18
|
+
|
|
3
19
|
## 0.30.2 (2026-10-01)
|
|
4
20
|
- [Feature] Add `ShareConsumer#events_poll` (and `#events_poll_nb`) to service the statistics, error, log and OAuthBearer callbacks without acquiring records.
|
|
5
21
|
|
|
6
22
|
## 0.30.1 (2026-09-30)
|
|
7
|
-
- [Fix]
|
|
23
|
+
- [Fix] Set `ShareConsumer#name` from the native handle at creation, so name-based callback routing (e.g. Karafka) no longer drops share-consumer statistics and errors.
|
|
8
24
|
|
|
9
25
|
## 0.30.0 (2026-09-25)
|
|
10
|
-
- [Fix] Register share consumers in `Rdkafka::Clients` and destroy the native handle when `Config#share_consumer` fails part-way
|
|
11
|
-
- [Feature] Add preview support for KIP-932 share groups ("Queues for Kafka") via `Rdkafka::ShareConsumer
|
|
12
|
-
- [Enhancement] `RdkafkaError.build_from_c` now uses the human
|
|
13
|
-
- [Enhancement]
|
|
14
|
-
- [Fix] Make `ShareConsumer#close` safe
|
|
15
|
-
- [Fix] Keep the `ShareConsumer` native handle and its GC finalizer when `close`/`destroy` report an error
|
|
16
|
-
- [Fix] Pin the acknowledgement commit callback `FFI::Function`
|
|
17
|
-
- [Fix] Make `ShareConsumer` fork-aware
|
|
18
|
-
- [Fix]
|
|
19
|
-
- [Fix] Raise `ArgumentError` for `ShareConsumer#subscribe` without topics
|
|
20
|
-
- [Fix] Capture the librdkafka client name onto `ShareConsumer#name` from the OAuthBearer token refresh callback
|
|
26
|
+
- [Fix] Register share consumers in `Rdkafka::Clients` and destroy the native handle when `Config#share_consumer` fails part-way, so a share consumer is no longer missed by the `at_exit` shutdown hook.
|
|
27
|
+
- [Feature] Add preview support for KIP-932 share groups ("Queues for Kafka") via `Rdkafka::ShareConsumer` (`Config#share_consumer`), with per-record acknowledgements (`:accept`, `:release`, `:reject`). Requires Apache Kafka 4.2.0+ with share groups enabled. Not production-ready.
|
|
28
|
+
- [Enhancement] `RdkafkaError.build_from_c` now uses the human-readable string librdkafka attaches to the `rd_kafka_error_t` instead of `rd_kafka_err2str`, improving diagnostics for every error-pointer path.
|
|
29
|
+
- [Enhancement] Refactor the `Helpers::OAuth` token plumbing around two private hooks so the share consumer overrides only those instead of duplicating both public methods.
|
|
30
|
+
- [Fix] Make `ShareConsumer#close` thread-safe: it now waits for in-flight operations (mirroring `NativeKafka`), preventing a double destroy when two threads race `close`.
|
|
31
|
+
- [Fix] Keep the `ShareConsumer` native handle and its GC finalizer when `close`/`destroy` report an error, so the client is no longer leaked and `close` stays retriable.
|
|
32
|
+
- [Fix] Pin the acknowledgement commit callback `FFI::Function` for the lifetime of the `ShareConsumer`, preventing a use-after-free when an unclosed consumer is garbage collected.
|
|
33
|
+
- [Fix] Make `ShareConsumer` fork-aware (mirroring `NativeKafka`): it reports `closed?` in a forked child, which no longer segfaults on `close` or finalization.
|
|
34
|
+
- [Fix] Rescue `ClosedConsumerError` in `ShareConsumer#each` only around `poll`, so a `ClosedConsumerError` raised inside the block propagates instead of silently ending iteration. Like `#poll`, `#each` can also yield an `RdkafkaError` for a record that fails to build.
|
|
35
|
+
- [Fix] Raise `ArgumentError` for `ShareConsumer#subscribe` without topics, which librdkafka otherwise treats as an unsubscribe without error, silently dropping the subscription.
|
|
36
|
+
- [Fix] Capture the librdkafka client name onto `ShareConsumer#name` from the OAuthBearer token refresh callback, since the share handle has no native name accessor for the documented name-based oauth callback routing.
|
|
21
37
|
- [Fix] Update `ext/build_common.sh` (precompiled builds) to librdkafka `2.15.0` and its tarball checksum; it still pinned `2.14.1`, whose tarball is no longer vendored.
|
|
22
|
-
- [Fix] Stop the `share_consumer_multi_member` integration spec from failing on
|
|
23
|
-
- [Fix] Apply the same at-least-once tolerance to the `share_consumer_explicit_ack` integration spec
|
|
24
|
-
- [Fix] Add the `nofile` ulimit to `docker-compose-ssl.yml
|
|
25
|
-
- [Fix] Enable KIP-932 share groups on the macOS CI broker, whose KRaft
|
|
26
|
-
- [Enhancement] Add
|
|
27
|
-
- [Fix] Stop the `statistics_unassigned_producer` integration spec from flaking on a metadata-propagation race
|
|
28
|
-
- [Fix] Also stabilize the `statistics_unassigned_producer` integration spec against a delivery wait that outlives its budget
|
|
29
|
-
- [Fix] Stabilize the `consumer_memberid_clusterid_leak` integration spec against RSS measurement noise on Ruby 4.0
|
|
30
|
-
- [Note] Share consumers emit the regular consumer statistics
|
|
38
|
+
- [Fix] Stop the `share_consumer_multi_member` integration spec from failing on an at-least-once redelivery; it now tracks distinct payloads and fails only when a record is never delivered.
|
|
39
|
+
- [Fix] Apply the same at-least-once tolerance to the `share_consumer_explicit_ack` integration spec: require only the released record to be redelivered, forbid the rejected one, and tolerate an accepted record reappearing.
|
|
40
|
+
- [Fix] Add the `nofile` ulimit to `docker-compose-ssl.yml` (mirroring `docker-compose.yml`) so the SSL CI broker does not exhaust file descriptors under the topic-heavy share-consumer suite.
|
|
41
|
+
- [Fix] Enable KIP-932 share groups on the macOS CI broker, whose KRaft config never opted into the share rebalance protocol, so its share-consumer spec no longer receives zero records. `CONFLUENT_VERSION` is bumped to `8.3.0`.
|
|
42
|
+
- [Enhancement] Add `share_consumer_implicit_ack` and `share_consumer_multi_topic` integration specs.
|
|
43
|
+
- [Fix] Stop the `statistics_unassigned_producer` integration spec from flaking on a metadata-propagation race by retrying the produce on `unknown_topic_or_part` and `leader_not_available`.
|
|
44
|
+
- [Fix] Also stabilize the `statistics_unassigned_producer` integration spec against a delivery wait that outlives its budget: it now uses the default 60s handle wait and retries on `WaitTimeoutError`.
|
|
45
|
+
- [Fix] Stabilize the `consumer_memberid_clusterid_leak` integration spec against RSS measurement noise on Ruby 4.0 by compacting the heap before sampling and raising the ceiling to 3 MB.
|
|
46
|
+
- [Note] Share consumers emit the regular consumer statistics through `statistics_callback`. librdkafka 2.15.0 has no share-specific metrics, so the `topics` section has no partition entries.
|
|
31
47
|
- [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. Ported from rdkafka-ruby (#983).
|
|
32
48
|
- [Enhancement] Bump librdkafka to `2.15.1` for OpenSSL and libcurl security fixes. It changes how IPv6 addresses are formatted and validated against broker certificates.
|
|
33
49
|
- [Enhancement] Bump the bundled zlib to `1.3.2`.
|
|
@@ -37,8 +53,8 @@
|
|
|
37
53
|
- [Maintenance] Drop the unused `dist/openssl-3.0.16.tar.gz` build cache.
|
|
38
54
|
- [Fix] Honor the `isolation_level:` argument to `Admin#list_offsets`, which was silently ignored. Ported from rdkafka-ruby (#983).
|
|
39
55
|
- [Fix] Return correct results for every item of a multi-item topic, partition, group or ACL admin request, not just the first. Ported from rdkafka-ruby (#987).
|
|
40
|
-
- [Maintenance] Fix a use-after-free in the multi-item admin integration test that
|
|
41
|
-
- [Maintenance] Stabilize consumer specs on slow CI runners
|
|
56
|
+
- [Maintenance] Fix a use-after-free in the multi-item admin integration test that made it flaky on newer glibc. Ported from rdkafka-ruby (#991).
|
|
57
|
+
- [Maintenance] Stabilize consumer specs on slow CI runners. The assignment wait is tunable via `RDKAFKA_TEST_ASSIGNMENT_TIMEOUT`. Ported from rdkafka-ruby (#990).
|
|
42
58
|
|
|
43
59
|
## 0.29.0 (2026-09-14)
|
|
44
60
|
- [Enhancement] Bump librdkafka to `2.15.0` (staying on `2.15.0` rather than `2.15.1` so users hitting a regression in `2.15.1` have a stable fallback).
|
|
@@ -126,8 +142,8 @@
|
|
|
126
142
|
- [Fix] Prevent cascading test failures in admin specs when a single handle leaks into the registry (from upstream).
|
|
127
143
|
|
|
128
144
|
## 0.24.0 (2026-02-25)
|
|
129
|
-
- **[Feature]** Add `Producer#queue_size` (and `#queue_length` alias) to report the number of messages waiting in the librdkafka output queue.
|
|
130
|
-
- **[Feature]** Add
|
|
145
|
+
- **[Feature]** Add `Producer#queue_size` (and the `#queue_length` alias) to report the number of messages waiting in the librdkafka output queue.
|
|
146
|
+
- **[Feature]** Add `enable_queue_io_events` and `enable_background_queue_io_events` to `Consumer`, `Producer` and `Admin` for fiber schedulers (Falcon, Async) and custom event loops (from upstream).
|
|
131
147
|
- **[Deprecation]** `AbstractHandle#wait` parameter `max_wait_timeout` (seconds) is deprecated in favor of `max_wait_timeout_ms` (milliseconds). The old parameter still works with backwards compatibility but will be removed in v1.0.0.
|
|
132
148
|
- **[Deprecation]** `PartitionsCountCache` constructor parameter `ttl` (seconds) is deprecated in favor of `ttl_ms` (milliseconds). The old parameter still works with backwards compatibility but will be removed in v1.0.0.
|
|
133
149
|
- [Enhancement] Add Ruby 4.0 support.
|
|
@@ -154,7 +170,7 @@
|
|
|
154
170
|
- [Enhancement] Add `RdkafkaError.build_fatal` class method for centralized fatal error construction.
|
|
155
171
|
- [Enhancement] Add comprehensive tests for fatal error handling including unit tests and integration tests.
|
|
156
172
|
- [Enhancement] Add `RD_KAFKA_PARTITION_UA` constant for unassigned partition (-1).
|
|
157
|
-
- [Enhancement] Replace magic numbers with
|
|
173
|
+
- [Enhancement] Replace magic numbers with the `RD_KAFKA_RESP_ERR_NO_ERROR` and `RD_KAFKA_PARTITION_UA` constants.
|
|
158
174
|
- [Enhancement] Add `Rdkafka::Testing` module for testing fatal error scenarios on both producers and consumers.
|
|
159
175
|
- [Deprecated] `RdkafkaError.validate_fatal!` - use `validate!` with `client_ptr` parameter instead.
|
|
160
176
|
|
|
@@ -168,7 +184,7 @@
|
|
|
168
184
|
|
|
169
185
|
## 0.22.1 (2025-10-09)
|
|
170
186
|
- [Enhancement] Optimize header processing to eliminate double hash lookups and method checking overhead.
|
|
171
|
-
- [Enhancement]
|
|
187
|
+
- [Enhancement] Speed up producer header processing (69% faster for nil headers, 41% for empty headers, 12-32% when headers are present).
|
|
172
188
|
|
|
173
189
|
## 0.22.0 (2025-09-26)
|
|
174
190
|
- **[EOL]** Drop support for Ruby 3.1 to move forward with the fiber scheduler work.
|
data/README.md
CHANGED
|
@@ -63,6 +63,7 @@ Contributions should generally be made to the upstream [rdkafka-ruby repository]
|
|
|
63
63
|
|
|
64
64
|
| karafka-rdkafka | librdkafka | patches |
|
|
65
65
|
|-|-|-|
|
|
66
|
+
| 0.31.x (2026-10-12) | 2.16.0 (2026-10-06) | yes |
|
|
66
67
|
| 0.30.x (2026-09-25) | 2.15.1 (2026-09-09) | yes |
|
|
67
68
|
| 0.29.x (2026-09-14) | 2.15.0 (2026-06-30) | yes |
|
|
68
69
|
| 0.28.x (2026-07-12) | 2.14.2 (2026-06-03) | yes |
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# This patch is released under the 2-clause BSD license, same as librdkafka
|
|
2
|
+
#
|
|
3
|
+
# Upstream: https://github.com/confluentinc/librdkafka/issues/5620
|
|
4
|
+
# Drop this patch once librdkafka sorts merged async share acknowledgements itself.
|
|
5
|
+
#
|
|
6
|
+
--- librdkafka_2.15.1/src/rdkafka_share_acknowledgement.c
|
|
7
|
+
+++ librdkafka_2.15.1/src/rdkafka_share_acknowledgement.c
|
|
8
|
+
@@ -656,6 +656,10 @@
|
|
9
|
+
&existing->entries,
|
|
10
|
+
rd_kafka_share_ack_batch_entry_copy(entry));
|
|
11
|
+
}
|
|
12
|
+
+ /* Batches merged from separate commits may interleave,
|
|
13
|
+
+ * while the broker requires ascending ack batches. */
|
|
14
|
+
+ rd_list_sort(&existing->entries,
|
|
15
|
+
+ rd_kafka_share_ack_entries_sort_cmp_ptr);
|
|
16
|
+
rd_kafka_share_ack_batches_destroy(batch);
|
|
17
|
+
} else {
|
|
18
|
+
rd_list_add(leader_rkb->rkb_share_async_ack_details,
|