Skip to content

Conversation

emasab
Copy link
Contributor

@emasab emasab commented Jun 18, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 19:22
@emasab emasab requested a review from a team as a code owner June 18, 2025 19:22
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link

@Copilot Copilot AI left a 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 implements KIP-1102 to enable clients to rebootstrap based on timeout or error code. Key changes include adding a new metadata recovery strategy, triggering rebootstrap in metadata handling, updating mock server behavior, and covering the feature in tests.

  • Introduce metadata.recovery.strategy and metadata.recovery.rebootstrap.trigger.ms configs and docs
  • Extend metadata error handling to detect a top-level error code and restart rebootstrap timer
  • Add tests for rebootstrap behavior with various bootstrap server settings

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/0152-rebootstrap.c New test exercising rebootstrap on timeout or error conditions
src/rdkafka_request.c Handle REBOOTSTRAP_REQUIRED error action and invoke rebootstrap
src/rdkafka_mock_handlers.c Mock Metadata handler updated to emit top-level error and empty responses
src/rdkafka_metadata.c Parse top-level error code in Metadata response and restart timer
src/rdkafka_int.h Add macros and declaration for rebootstrap timer restart
src/rdkafka_conf.h Add metadata_recovery_rebootstrap_trigger_ms conf field
src/rdkafka_conf.c Register new config property and update metadata.recovery.strategy docs
src/rdkafka.c Implement rd_kafka_rebootstrap and timer restart functions
INTRODUCTION.md Document KIP-1102 support
CONFIGURATION.md Add new config description
CHANGELOG.md Release notes for v2.11.0
Comments suppressed due to low confidence (5)

tests/0152-rebootstrap.c:70

  • This loop can hang indefinitely if the error callback never fires. Consider adding a timeout or maximum retry count to fail the test gracefully.
        while (!brokers_add_all_brokers_down_received) {

src/rdkafka_metadata.c:575

  • [nitpick] Local variable ErrorCode uses PascalCase, which is inconsistent with the file's snake_case naming. Consider renaming to error_code.
        int16_t ErrorCode             = 0;

src/rdkafka_conf.c:444

  • [nitpick] Inconsistent spelling: re-bootstrap is hyphenated here but rebootstrap is used elsewhere. Also update to match project style (no hyphen).
     "is available. If set to `none`, the client doesn't re-bootstrap. "

CHANGELOG.md:124

  • [nitpick] Grammar: change avoid to avoids, and consider removing the hyphen in re-bootstrapping for consistency.
  Setting `metadata.recovery.strategy` to `none` avoid any re-bootstrapping and

src/rdkafka_mock_handlers.c:1486

  • requested_topics is only freed in the error branch; in the normal path it is never destroyed before return, leading to a memory leak. Move the destroy call to cover both paths.
send_response:

src/rdkafka.c Outdated
Comment on lines 2083 to 2105
RD_KAFKA_METADATA_RECOVERY_STRATEGY_NONE)
/* This function should not be called in this case.
* this is just a fail-safe. */
return;
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] One-line if without braces can introduce errors if the code is later extended. Consider adding braces for clarity and safety.

Suggested change
RD_KAFKA_METADATA_RECOVERY_STRATEGY_NONE)
/* This function should not be called in this case.
* this is just a fail-safe. */
return;
RD_KAFKA_METADATA_RECOVERY_STRATEGY_NONE) {
/* This function should not be called in this case.
* this is just a fail-safe. */
return;
}

Copilot uses AI. Check for mistakes.

@emasab emasab changed the base branch from master to dev_kip1102_fix_rebootstrap_trigger_calculation August 27, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant