Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AEE87200C52 for ; Mon, 10 Apr 2017 12:58:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AD730160BA5; Mon, 10 Apr 2017 10:58:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 00D03160B85 for ; Mon, 10 Apr 2017 12:58:44 +0200 (CEST) Received: (qmail 77221 invoked by uid 500); 10 Apr 2017 10:58:44 -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 77208 invoked by uid 99); 10 Apr 2017 10:58:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 10:58:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 6F5C2C036E for ; Mon, 10 Apr 2017 10:58:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id b9xCBo8OGAAj for ; Mon, 10 Apr 2017 10:58:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 822835FAF3 for ; Mon, 10 Apr 2017 10:58:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1E25EE0629 for ; Mon, 10 Apr 2017 10:58:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id C73EE24069 for ; Mon, 10 Apr 2017 10:58:41 +0000 (UTC) Date: Mon, 10 Apr 2017 10:58:41 +0000 (UTC) From: "Rajini Sivaram (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-5044) max.in.flight.requests.per.connection > 1 is ineffective MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 10 Apr 2017 10:58:45 -0000 [ https://issues.apache.org/jira/browse/KAFKA-5044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15962709#comment-15962709 ] Rajini Sivaram commented on KAFKA-5044: --------------------------------------- [~twbecker] {{max.in.flight.requests.per.connection}} is the number of requests for which responses may be outstanding. Each connection may have only one send in progress at any time. But if {{max.in.flight.requests.per.connection=5}}, upto 5 requests may be sent one after the other, before any response is received from the server. So the checks in the code verify the two cases (a) whether the previous send has completed and (b) whether the number of responses still outstanding is within max.in.flight. > max.in.flight.requests.per.connection > 1 is ineffective > -------------------------------------------------------- > > Key: KAFKA-5044 > URL: https://issues.apache.org/jira/browse/KAFKA-5044 > Project: Kafka > Issue Type: Bug > Components: clients > Reporter: Tommy Becker > > While looking at the NetworkClient code, I became suspicious about the implementation of org.apache.kafka.clients.InFlightRequests#canSendMore, which seems responsible for enforcing max.in.flight.requests.per.connection > {code} > public boolean canSendMore(String node) { > Deque queue = requests.get(node); > return queue == null || queue.isEmpty() || > (queue.peekFirst().send.completed() && queue.size() < this.maxInFlightRequestsPerConnection); > } > {code} > If the most recent request has not been completed, then this returns false even if we are under the maxInFlightRequestsPerConnection limit. I wonder if I am misunderstanding how this parameter is supposed to work, as this code has been there quite some time. But I wrote a unit test that tries to send a second request with one outstanding and it does indeed fail, despite maxInFlightRequestsPerConnection being set to Integer.MAX_VALUE. I'll create a PR with my test and possible fix. -- This message was sent by Atlassian JIRA (v6.3.15#6346)