kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch 2.0 updated: KAFKA-5503; Idempotent producer ignores shutdown while fetching ProducerId (#5881)
Date Wed, 02 Jan 2019 23:07:07 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.0 by this push:
     new ffdb220  KAFKA-5503; Idempotent producer ignores shutdown while fetching ProducerId
(#5881)
ffdb220 is described below

commit ffdb220862bee3fe007096a94d88f5b3ee22aba3
Author: layfe <layfe@mail.ru>
AuthorDate: Thu Jan 3 02:00:40 2019 +0300

    KAFKA-5503; Idempotent producer ignores shutdown while fetching ProducerId (#5881)
    
    Check `running` in `Sender.maybeWaitForProducerId` to ensure that the producer can be
closed while awaiting initialization of the producerId.
    
    Reviewers: Jason Gustafson <jason@confluent.io>
---
 .../main/java/org/apache/kafka/clients/producer/internals/Sender.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
b/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
index 5cb9046..b68ce36 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
@@ -422,7 +422,7 @@ public class Sender implements Runnable {
     }
 
     private void maybeWaitForProducerId() {
-        while (!transactionManager.hasProducerId() && !transactionManager.hasError())
{
+        while (running && !transactionManager.hasProducerId() && !transactionManager.hasError())
{
             try {
                 Node node = awaitLeastLoadedNodeReady(requestTimeoutMs);
                 if (node != null) {


Mime
View raw message