[ https://issues.apache.org/jira/browse/KAFKA-5044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15961539#comment-15961539 ]
ASF GitHub Bot commented on KAFKA-5044: --------------------------------------- GitHub user twbecker opened a pull request: https://github.com/apache/kafka/pull/2827 Fix KAFKA-5044. InFlightRequests#canSendMore should not require that previous sends completed if we are under the maxInFlightRequestsPerConnection limit. You can merge this pull request into a Git repository by running: $ git pull https://github.com/twbecker/kafka KAFKA-5044 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/2827.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2827 ---- commit fb3887d81eabd9af35e153bf0b5435623e01da3f Author: Tommy Becker <twbec...@gmail.com> Date: 2017-04-07T22:27:40Z Fix KAFKA-5044. InFlightRequests#canSendMore should not require that previous sends completed if we are under the maxInFlightRequestsPerConnection limit. ---- > 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)