From owner-freebsd-net@FreeBSD.ORG Tue Dec 6 18:36:55 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97E5F16A41F for ; Tue, 6 Dec 2005 18:36:55 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4244943D7C for ; Tue, 6 Dec 2005 18:36:52 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id jB6IaorD092069; Tue, 6 Dec 2005 10:36:50 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id jB6Iamjd092068; Tue, 6 Dec 2005 10:36:48 -0800 (PST) (envelope-from jmg) Date: Tue, 6 Dec 2005 10:36:48 -0800 From: John-Mark Gurney To: Igor Sysoev Message-ID: <20051206183648.GG55657@funkthat.com> Mail-Followup-To: Igor Sysoev , freebsd-net@freebsd.org References: <20050901140051.G11484@is.park.rambler.ru> <20050901182115.F11484@is.park.rambler.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050901182115.F11484@is.park.rambler.ru> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-net@freebsd.org Subject: Re: strange timeout error returned by kevent() in 6.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2005 18:36:55 -0000 Igor Sysoev wrote this message on Thu, Sep 01, 2005 at 18:26 +0400: > On Thu, 1 Sep 2005, Igor Sysoev wrote: > > >I found strange timeout errors returned by kevent() in 6.0 using > >my http server named nginx. The nginx's run on three machines: > >two 4.10-RELEASE and one 6.0-BETA3. All machines serve the same > >content (simple cluster) and each handles about 200 requests/second. > > > >On 6.0 sometimes (2 or 3 times per hour) in the daytime kevent() > >returns EV_EOF in flags and ETIMEDOUT in fflags, nevertheless: > > > >1) nginx does not set any kernel timeout for sockets; > >2) the total request time for such failed requests is small, 30 and so > >seconds. > > I have changed code to ignore the ETIMEDOUT error returned by kevent() > and found that subsequent sendfile() returned the ENOTCONN. > > By the way, why sendfile() may return ENOTCONN ? > I saw this error code on 4.x too. The reason that you are seeing ETIMEDOUT/ENOTCONN is that the connection probably ETIMEDOUT (aka timed out)... and so is ENOTCONN (no longer connected).. can you also do a read or a write to the socket successfully? and sendfile(3) says: ERRORS [...] [ENOTCONN] The s argument points to an unconnected socket. and a glance at tcp(4) says: ERRORS [...] [ETIMEDOUT] when a connection was dropped due to excessive retransmissions; There's the answers... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."