Skip to content
Merged
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
11 changes: 10 additions & 1 deletion src/confluent_kafka/src/Admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -4536,7 +4536,16 @@ static PyObject * Admin_c_SingleGroupResult_to_py(const rd_kafka_group_result_t

kwargs = PyDict_New();

cfl_PyDict_SetString(kwargs, "group_id", rd_kafka_group_result_name(c_group_result_response));
/* Safely handle potential NULL group name from librdkafka */
const char *group_name = rd_kafka_group_result_name(c_group_result_response);
if (!group_name) {
cfl_PyErr_Format(RD_KAFKA_RESP_ERR__FAIL,
"Received NULL group name from librdkafka");
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The error message 'Received NULL group name from librdkafka' doesn't provide actionable information to users. Consider including guidance such as 'Internal error: received NULL group name from librdkafka. This may indicate a broker communication failure or coordinator unavailability.'

Suggested change
"Received NULL group name from librdkafka");
"Internal error: received NULL group name from librdkafka. This may indicate a broker communication failure or coordinator unavailability.");

Copilot uses AI. Check for mistakes.
Py_DECREF(kwargs);
Py_DECREF(GroupResult_type);
return NULL;
}
cfl_PyDict_SetString(kwargs, "group_id", group_name);

c_topic_partition_offset_list = rd_kafka_group_result_partitions(c_group_result_response);
if(c_topic_partition_offset_list) {
Expand Down