kafka-go icon indicating copy to clipboard operation
kafka-go copied to clipboard

panic when client returns an error instead of protocol response

Open dmarkhas opened this issue 2 years ago • 1 comments

In continuation to https://github.com/segmentio/kafka-go/pull/925, we are seeing the same behavior in other APIs, such as ListGroups, DescribeGroups, etc.

For example from the listgroups protocol:

func (r *Response) Merge(requests []protocol.Message, results []interface{}) (
	protocol.Message,
	error,
) {
	response := &Response{}

	for r, result := range results {
		brokerResp := result.(*Response)
		respGroups := []ResponseGroup{}

		for _, brokerResp := range brokerResp.Groups {
			respGroups = append(
				respGroups,
				ResponseGroup{
					GroupID:      brokerResp.GroupID,
					ProtocolType: brokerResp.ProtocolType,
					BrokerID:     requests[r].(*Request).brokerID,
				},
			)
		}

		response.Groups = append(response.Groups, respGroups...)
	}

	return response, nil
}

dmarkhas avatar Jul 26 '22 09:07 dmarkhas

Hi @dmarkhas we recently fixed those in https://github.com/segmentio/kafka-go/pull/931 and https://github.com/segmentio/kafka-go/pull/942, just now I tagged a new release https://github.com/segmentio/kafka-go/releases/tag/v0.4.33 can you check and see if that fixes it for you?

nlsun avatar Jul 29 '22 17:07 nlsun