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 3517B17C8E for ; Tue, 6 Oct 2015 22:19:27 +0000 (UTC) Received: (qmail 35177 invoked by uid 500); 6 Oct 2015 22:19:26 -0000 Delivered-To: apmail-kafka-dev-archive@kafka.apache.org Received: (qmail 35079 invoked by uid 500); 6 Oct 2015 22:19:26 -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 35062 invoked by uid 99); 6 Oct 2015 22:19:26 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Oct 2015 22:19:26 +0000 Date: Tue, 6 Oct 2015 22:19:26 +0000 (UTC) From: "Ismael Juma (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (KAFKA-2614) No more clients can connect after `TooManyConnectionsException` threshold (max.connections.per.ip) is reached 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-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ismael Juma reassigned KAFKA-2614: ---------------------------------- Assignee: Ismael Juma > No more clients can connect after `TooManyConnectionsException` threshold (max.connections.per.ip) is reached > ------------------------------------------------------------------------------------------------------------- > > Key: KAFKA-2614 > URL: https://issues.apache.org/jira/browse/KAFKA-2614 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.8.2.1 > Environment: Debian Jessie > Reporter: Stephen Chu > Assignee: Ismael Juma > Priority: Critical > Fix For: 0.9.0.0 > > > It seems no more clients can connect to Kafka after `max.connections.per.ip` is reached, even if previous clients were already disconnected. > Using 0.8.3 (9c936b18), upon starting a fresh Kafka server that is configured with (max.connections.per.ip = 24), I noticed that I can cause the server to hit the error case of {{INFO Rejected connection from /0:0:0:0:0:0:0:1, address already has the configured maximum of 24 connections.}} very quickly, by simply looping through a bunch of simple clients against the server: > {noformat} > #! /bin/bash > for i in {1..30}; do > # either: > nc -vz 127.0.0.1 9092; > # or: > ( telnet 127.0.0.1 9092; ) & > done > # if using telnet, kill all connected jobs now via: > kill %{2..31} > {noformat} > The problem seems to be that the counter for such short-lived client connections aren't properly decrementing when using the `max.connections.per.ip` feature. > Turning on DEBUG logs, I cannot see the log lines "Closing connection from xxx" on [this line|https://github.com/apache/kafka/blob/0.8.2/core/src/main/scala/kafka/network/SocketServer.scala#L164] from the first few still-under-threshold short-lived connections, but starts showing *after* I hit the limit per that config. -- This message was sent by Atlassian JIRA (v6.3.4#6332)