-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[KIP-1102] Tests for: Enable clients to rebootstrap based on timeout or error code #5119
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
base: dev_kip1102_fix_rebootstrap_trigger_calculation
Are you sure you want to change the base?
[KIP-1102] Tests for: Enable clients to rebootstrap based on timeout or error code #5119
Conversation
🎉 All Contributor License Agreements have been signed. Ready to merge. |
5c5a11c
to
7aa511b
Compare
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 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
andmetadata.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 toerror_code
.
int16_t ErrorCode = 0;
src/rdkafka_conf.c:444
- [nitpick] Inconsistent spelling:
re-bootstrap
is hyphenated here butrebootstrap
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
toavoids
, and consider removing the hyphen inre-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
RD_KAFKA_METADATA_RECOVERY_STRATEGY_NONE) | ||
/* This function should not be called in this case. | ||
* this is just a fail-safe. */ | ||
return; |
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] One-line if
without braces can introduce errors if the code is later extended. Consider adding braces for clarity and safety.
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.
7aa511b
to
079bf9a
Compare
No description provided.