From owner-freebsd-stable@FreeBSD.ORG Fri Nov 30 10:26:16 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E4816A41B for ; Fri, 30 Nov 2007 10:26:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.179]) by mx1.freebsd.org (Postfix) with ESMTP id B7C6113C455 for ; Fri, 30 Nov 2007 10:26:15 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so4814674pyb for ; Fri, 30 Nov 2007 02:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=76Jwf1kiw3PaR/8huV4De74eEIj26uXSTM60tUviAsc=; b=v3cT6I4JLLxjRvi7g/h4tF6IFVQQ8IuiwHkY1uNpGLOgcsIZFyV6FxWmlaE+l4wLa1otfxzULLizg9OW6QLc+VmNJSdCGh1P8f8SrtYPsLplsbURtnTp7rBNUmdJQJ6Jl4dupTowyRVAer5Kp/jrM8ThUALB3gXNuUrQiq1GxWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Vh4hc+MpqTkjfP3FKcPmvwsCSh03IVZUrOLk9RzCiRkNZqwjAwW5GaiofnnN5WKRT8kgeI4hL5h7zbz8xLlze6WoWfUqbxxVlSn4rXtObLfsRGn3UE94uj7RgfJrwux50QVIF2r5VdMhEYhGxj7NjleUoVSHFwJOYJXppJo9UeY= Received: by 10.65.242.7 with SMTP id u7mr507745qbr.1196418374623; Fri, 30 Nov 2007 02:26:14 -0800 (PST) Received: by 10.65.155.16 with HTTP; Fri, 30 Nov 2007 02:26:14 -0800 (PST) Message-ID: Date: Fri, 30 Nov 2007 19:26:14 +0900 From: "Adrian Chadd" Sender: adrian.chadd@gmail.com To: "Jan Srzednicki" In-Reply-To: <20071130093628.GS2045@oak.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071127135320.GJ2045@oak.pl> <474DB1D0.3010100@elischer.org> <20071128183001.GQ2045@oak.pl> <474DB6B3.1020202@elischer.org> <20071130093628.GS2045@oak.pl> X-Google-Sender-Auth: ef1752d998247e30 Cc: freebsd-net@freebsd.org, freebsd-stable@freebsd.org, Julian Elischer Subject: Re: connect() returns EADDRINUSE during massive host->host conn rate X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2007 10:26:16 -0000 On 30/11/2007, Jan Srzednicki wrote: > Most of the relevant sockets (that is, between the two host mentioned) > are in the ESTABLISHED state (200-400 of those). Only 20-40 are in > TIME_WAIT state (these tend to be from a more ephemeric POP3 service). Most > of the EADDRINUSE happen for the IMAP4 service. I'd probably start by patching the places in the tcp code (src/sys/netinet/tcp_usrreq.c) which returns this error (Its returned in other places but that seems to me to be the most likely from your description.) Insert some code to print out information about the current socket and the "oinp" value returned from in_pcbconnect_setup() (if this is the place where the error occured.) Finding out more about the socket thats been created and what its clashing with might help. I'd do it myself but I'm not sure how to duplicate the issue. Adrian -- Adrian Chadd - adrian@freebsd.org