Skip to content

Commit

Permalink
Support ability to release patches (#110)
Browse files Browse the repository at this point in the history
* Support ability to release patches

* improve docs
  • Loading branch information
mensfeld authored Jul 30, 2024
1 parent 45b8178 commit 4894794
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Rdkafka Changelog

## 0.17.1 (Unreleased)
- [Enhancement] Support ability to release patches to librdkafka.
- [Patch] Patch cooperative-sticky assignments in librdkafka.

## 0.17.0 (2024-07-21)
- [Enhancement] Bump librdkafka to 2.5.0

Expand Down
26 changes: 26 additions & 0 deletions dist/patches/rdkafka_sticky_assignor.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This patch is released under the 2-clause BSD license, same as librdkafka
# Fixes: https://github.com/confluentinc/librdkafka/issues/4783
#
--- librdkafka_2.5.0/src/rdkafka_sticky_assignor.c 2024-07-08 09:47:43.000000000 +0200
+++ librdkafka_2.5.0/src/rdkafka_sticky_assignor.c 2024-07-30 09:44:38.529759640 +0200
@@ -769,7 +769,7 @@
const rd_kafka_topic_partition_list_t *partitions;
const char *consumer;
const rd_map_elem_t *elem;
- int i;
+ int i, j;

/* The assignment is balanced if minimum and maximum numbers of
* partitions assigned to consumers differ by at most one. */
@@ -836,9 +836,9 @@

/* Otherwise make sure it can't get any more partitions */

- for (i = 0; i < potentialTopicPartitions->cnt; i++) {
+ for (j = 0; j < potentialTopicPartitions->cnt; j++) {
const rd_kafka_topic_partition_t *partition =
- &potentialTopicPartitions->elems[i];
+ &potentialTopicPartitions->elems[j];
const char *otherConsumer;
int otherConsumerPartitionCount;

3 changes: 3 additions & 0 deletions ext/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ task :default => :clean do
}
recipe.configure_options = ["--host=#{recipe.host}"]

recipe.patch_files = Dir[File.join(releases, 'patches', "*.patch")].sort

# Disable using libc regex engine in favor of the embedded one
# The default regex engine of librdkafka does not always work exactly as most of the users
# would expect, hence this flag allows for changing it to the other one
Expand Down Expand Up @@ -117,6 +119,7 @@ namespace :build do
recipe = MiniPortile.new("librdkafka", version)
recipe.files << "https://github.com/confluentinc/librdkafka/archive/#{ref}.tar.gz"
recipe.configure_options = ["--host=#{recipe.host}","--enable-static", "--enable-zstd"]
recipe.patch_files = Dir[File.join(releases, 'patches', "*.patch")].sort
recipe.cook

ext = recipe.host.include?("darwin") ? "dylib" : "so"
Expand Down
2 changes: 1 addition & 1 deletion lib/rdkafka/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Rdkafka
VERSION = "0.17.0"
VERSION = "0.17.1"
LIBRDKAFKA_VERSION = "2.5.0"
LIBRDKAFKA_SOURCE_SHA256 = "3dc62de731fd516dfb1032861d9a580d4d0b5b0856beb0f185d06df8e6c26259"
end

0 comments on commit 4894794

Please sign in to comment.