You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/07 22:48:41 UTC

[jira] [Commented] (KAFKA-5044) max.in.flight.requests.per.connection > 1 is ineffective

    [ https://issues.apache.org/jira/browse/KAFKA-5044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15961535#comment-15961535 ] 

ASF GitHub Bot commented on KAFKA-5044:
---------------------------------------

Github user twbecker closed the pull request at:

    https://github.com/apache/kafka/pull/2826


> 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<NetworkClient.InFlightRequest> 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)