chia7712 commented on code in PR #18672:
URL: https://github.com/apache/kafka/pull/18672#discussion_r2483927893


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:
##########
@@ -664,14 +674,17 @@ private void handleShareFetchSuccess(Node fetchTarget,
 
                 log.debug("ShareFetch for partition {} returned fetch data 
{}", tip, partitionData);
 
-                Acknowledgements acks = 
fetchAcknowledgementsInFlight.remove(tip);
-                if (acks != null) {
-                    if (partitionData.acknowledgeErrorCode() != 
Errors.NONE.code()) {
-                        
metricsManager.recordFailedAcknowledgements(acks.size());
+                Map<TopicIdPartition, Acknowledgements> 
nodeAcknowledgementsInFlight = 
fetchAcknowledgementsInFlight.get(fetchTarget.id());
+                if (nodeAcknowledgementsInFlight != null) {
+                    Acknowledgements acks = 
nodeAcknowledgementsInFlight.remove(tip);
+                    if (acks != null) {
+                        if (partitionData.acknowledgeErrorCode() != 
Errors.NONE.code()) {
+                            
metricsManager.recordFailedAcknowledgements(acks.size());
+                        }
+                        
acks.complete(Errors.forCode(partitionData.acknowledgeErrorCode()).exception());

Review Comment:
   Should we respect the error message? The server can return the error message 
based on `PartitionData`, allowing the share consumer to provide a more useful 
exception to users
   
   
https://github.com/apache/kafka/blob/1e547dee782052ac298663eec89941873cbf59d6/core/src/main/scala/kafka/server/KafkaApis.scala#L3267
   
   @AndrewJSchofield WDYT? I can file a minor patch for it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to