Return-Path: X-Original-To: apmail-kafka-dev-archive@www.apache.org Delivered-To: apmail-kafka-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 543EB10F3E for ; Tue, 4 Mar 2014 18:51:30 +0000 (UTC) Received: (qmail 40789 invoked by uid 500); 4 Mar 2014 18:51:29 -0000 Delivered-To: apmail-kafka-dev-archive@kafka.apache.org Received: (qmail 40437 invoked by uid 500); 4 Mar 2014 18:51:27 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 40122 invoked by uid 99); 4 Mar 2014 18:51:25 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2014 18:51:25 +0000 Date: Tue, 4 Mar 2014 18:51:25 +0000 (UTC) From: "Guozhang Wang (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-1286) Retry Can Block MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919756#comment-13919756 ] Guozhang Wang commented on KAFKA-1286: -------------------------------------- Created reviewboard https://reviews.apache.org/r/18740/ against branch origin/trunk > Retry Can Block > ---------------- > > Key: KAFKA-1286 > URL: https://issues.apache.org/jira/browse/KAFKA-1286 > Project: Kafka > Issue Type: Sub-task > Components: producer > Reporter: Guozhang Wang > Attachments: KAFKA-1286.patch > > > Under the following scenario the retry logic can block > 1. The last broker's socket closed, sender.handleDisconnect() triggered, put the node as disconnected. > 2. In the next sender.run(), since the node is disconnected, remove the partition from ready set, and call sender.initConnection(), which will not throw exception. > 3. So in this round of send, the only request it tries to send to is the metadata request, to the last broker; and the sender will firstly try to connect to that broker. > 4. In selector.poll(), the finishConnect() call will throw exception, and in handleDisconnects(), inFlight request's batches will be null since it is a metadata request. > 5. Now we will go back to 1, and loop forever. Note that this infinite loop can be triggered even without calling producer.close. > Also, we need to introduce the retry backoff config, otherwise the retries will be exhausted too soon (in my tests 10 retries can be exhausted in about 600ms). -- This message was sent by Atlassian JIRA (v6.2#6252)