-
-
Notifications
You must be signed in to change notification settings - Fork 122
Post close yield fix #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post close yield fix #591
Conversation
* implement purge for producer * add extra spec
* producer transactions * stability * fix * cleanup and specs
* use WeakMap reference and object reference * store opaque in inner * fix spec * remove Ruby 2.6 support * stabilize spec * producer GC operations specs * admin and consumer gc specs * fix specs * give time to update (test) * test * give time to update (test) * stabilize specs * stabilize specs * stabilize specs * stabilize specs * stabilize specs * bump version for future merger with rdkafka-ruby * improve spec stability
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* bump librdkafka to 2.10.0 * use correct checksum * remarks * alignments
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* align defaults with deprecs on librdkafka 2.10 * changelog fixes * remarks * fix last * remarks * fix desc * mitigate logger * use default cluster value
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
|
arg not this repo, this will receive the same as a cherry pick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a post-close hook for native Kafka resources, standardizes error handling via RdkafkaError.validate!, adds transactional APIs to the producer, and enhances metadata support in consumer partition lists.
- Add
yieldinNativeKafka.closeto run cleanup code before destruction - Refactor manual response checks to use
RdkafkaError.validate!/build - Implement transactional methods on
Producerand support offset metadata in consumer code
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/rdkafka/producer/delivery_handle.rb | Fix error delivery report creation logic |
| lib/rdkafka/producer.rb | Add init/begin/commit/abort transaction methods and refactor flush/purge/produce |
| lib/rdkafka/native_kafka.rb | Yield to an optional block before destroying the native client |
| lib/rdkafka/metadata.rb | Replace manual error raise with RdkafkaError.validate! |
| lib/rdkafka/error.rb | Introduce build, build_from_c, validate!, and details attr |
| lib/rdkafka/consumer/topic_partition_list.rb | Support metadata in topic-partition lists |
| lib/rdkafka/consumer/partition.rb | Add metadata attribute and include it in to_s |
| lib/rdkafka/consumer.rb | Replace explicit response checks with validate! |
| lib/rdkafka/bindings.rb | Update FFI signatures (e.g., topic_partition_list_add) and add transaction bindings |
| lib/rdkafka/admin/incremental_alter_configs_report.rb | Simplify error handling via validate! |
| lib/rdkafka/admin/describe_configs_report.rb | Simplify error handling via validate! |
| lib/rdkafka/admin/delete_topic_handle.rb | Use validate! instead of manual RdkafkaError.new |
| lib/rdkafka/admin/create_topic_handle.rb | Use validate! instead of manual RdkafkaError.new |
| lib/rdkafka/admin/create_partitions_handle.rb | Use validate! instead of manual RdkafkaError.new |
| lib/rdkafka/admin/config_binding_result.rb | Change synonyms mapping to append into @synonyms |
| lib/rdkafka/admin.rb | Remove an extra blank line |
| lib/rdkafka/abstract_handle.rb | Switch raise_error to use validate! |
| karafka-rdkafka.gemspec | Rename gem to karafka-rdkafka and update URIs |
| README.md | Update version table to include unreleased and recent versions |
| CHANGELOG.md | Rebase changelog entries under new version headings |
Comments suppressed due to low confidence (1)
lib/rdkafka/producer/delivery_handle.rb:28
- In the zero-response branch, DeliveryReport.new is called without passing the topic argument, causing parameters to shift (label becomes error). You should invoke it as DeliveryReport.new(partition, offset, topic, nil, label).
if self[:response] == 0
|
|
||
| (1..pointer_to_size_t.read_int).map do |ar| | ||
| self.class.new synonyms_ptr[ar - 1] | ||
| @synonyms << self.class.new(synonyms_ptr[ar - 1]) |
Copilot
AI
May 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # @param partitions_with_offsets [Hash<Integer, Integer>] The topic's partitions and offsets | ||
| # @param partitions_with_offsets [Array<Consumer::Partition>] The topic's partitions with offsets | ||
| # and metadata (if any) | ||
| # |
Copilot
AI
May 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The @param tag for partitions_with_offsets is duplicated with different types (Hash vs Array). Consider consolidating into one or clarifying both overloads.
| # @param partitions_with_offsets [Hash<Integer, Integer>] The topic's partitions and offsets | |
| # @param partitions_with_offsets [Array<Consumer::Partition>] The topic's partitions with offsets | |
| # and metadata (if any) | |
| # | |
| # @param partitions_with_offsets [Hash<Integer, Integer>, Array<Consumer::Partition>] The topic's partitions and offsets. | |
| # If a Hash is provided, the keys represent partition numbers, and the values represent offsets. | |
| # If an Array is provided, it should contain `Consumer::Partition` objects, which may include offsets | |
| # and metadata (if any). |
No description provided.