From owner-freebsd-questions@FreeBSD.ORG Fri Apr 30 23:10:06 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AAA031065670 for ; Fri, 30 Apr 2010 23:10:06 +0000 (UTC) (envelope-from joerg@mysql.com) Received: from gmp-eb-inf-2.sun.com (gmp-eb-inf-2.sun.com [192.18.6.24]) by mx1.freebsd.org (Postfix) with ESMTP id 21A758FC12 for ; Fri, 30 Apr 2010 23:10:05 +0000 (UTC) Received: from fe-emea-13.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged)) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o3UNA4Nr019210 for ; Fri, 30 Apr 2010 23:10:05 GMT MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-15 Received: from conversion-daemon.fe-emea-13.sun.com by fe-emea-13.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0L1P00K00PMXKM00@fe-emea-13.sun.com> for freebsd-questions@freebsd.org; Sat, 01 May 2010 00:09:51 +0100 (BST) Received: from [129.150.118.126] ([unknown] [129.150.118.126]) by fe-emea-13.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <0L1P00JQ1POE8900@fe-emea-13.sun.com>; Sat, 01 May 2010 00:09:51 +0100 (BST) Date: Sat, 01 May 2010 01:09:49 +0200 From: Joerg Bruehe In-reply-to: <20100430221418.GJ14572@dan.emsphone.com> Sender: Joerg.Bruehe@Sun.COM To: Dan Nelson Message-id: <4BDB633D.6060509@mysql.com> Content-transfer-encoding: quoted-printable References: <4BD9D098.8010201@mysql.com> <20100429194932.GI14572@dan.emsphone.com> <4BDB49FF.4000303@mysql.com> <20100430221418.GJ14572@dan.emsphone.com> User-Agent: Thunderbird 2.0.0.23 (X11/20090817) Cc: FreeBSD-Questions Subject: Re: Need info about FreeBSD and interrupted system calls for MySQL code X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 23:10:06 -0000 Dan, your info is very valuable - thanks: Dan Nelson wrote: > In the last episode (Apr 30), Joerg Bruehe said: >> Dan Nelson wrote: >>> In the last episode (Apr 29), Joerg Bruehe said: >>>> For some long, unknown time, the MySQL code contains a variable >>>> "net_retry_count" which is by default set to 10 (ten) for all platfo= rms, >>>> but to 1000000 (1 million) for FreeBSD (during configure phase). >>>> >>>> The source code comment about this variable reads >>>> If a read on a communication port is interrupted, retry this = many >>>> times before giving up. >>>> >>>> [[...]] >>> I'm pretty sure this is a holdover from when FreeBSD only had a user >>> pthreads package (libc_r). [[...]] >> Interesting information - thanks. I never heard that before, but it >> explains a lot. >=20 > This may also have been due to a bug in the early libc_r code. Appropr= iate > use of sigwait() and pthread_sigmask() should let the pthreads library = know > which read() calls it can silently retry on behalf of threads that are > ignoring signals (and thus shouldn't have their syscalls aborted with > EINTR). I have email records talking about libc_r problems with signal= > masking from the FreeBSD 2.2.7 days (~1998). It's possible that later > libc_r versions had fixed the bug. I used to have copies of the ancien= t > mysql source code around (3.22 and 3.23 era), but have since deleted th= em, > so I don't know when the 1000000 workaround was added. The readily available revision control history of the MySQL source code goes back to the year 2000 only (the system used was changed back then, without history transfer), but a colleague checked that this workaround is documented in the manual of 3.22. All this seems to be a good indication we should get rid of this. Thanks for your help, J=F6rg --=20 Joerg Bruehe, MySQL Build Team, Joerg.Bruehe@Sun.COM (+49 30) 417 01 487 Sun Microsystems GmbH, Komturstrasse 18a, D-12099 Berlin Geschaeftsfuehrer: Juergen Kunz Amtsgericht Muenchen: HRB161028