Skip to content
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

Fix segfault when broker has no OffsetFetch support #4790

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/rdkafka_assignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,21 +315,23 @@ static void rd_kafka_assignment_handle_OffsetFetch(rd_kafka_t *rk,
rd_kafka_dbg(
rk, CGRP, "OFFSET",
"Offset fetch error for %d partition(s): %s",
offsets->cnt, rd_kafka_err2str(err));
offsets ? offsets->cnt : 0, rd_kafka_err2str(err));
rd_kafka_consumer_err(
rk->rk_consumer.q, rd_kafka_broker_id(rkb), err, 0,
NULL, NULL, RD_KAFKA_OFFSET_INVALID,
"Failed to fetch committed offsets for "
"%d partition(s) in group \"%s\": %s",
offsets->cnt, rk->rk_group_id->str,
offsets ? offsets->cnt : 0, rk->rk_group_id->str,
rd_kafka_err2str(err));
}
}

/* Apply the fetched offsets to the assignment */
rd_kafka_assignment_apply_offsets(rk, offsets, err);
if (offsets) {
/* Apply the fetched offsets to the assignment */
rd_kafka_assignment_apply_offsets(rk, offsets, err);

rd_kafka_topic_partition_list_destroy(offsets);
rd_kafka_topic_partition_list_destroy(offsets);
}
}


Expand Down