From owner-freebsd-bugs Sat Feb 22 8:54: 1 2003 Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A81537B401 for ; Sat, 22 Feb 2003 08:54:00 -0800 (PST) Received: from mail.imp.ch (mail.imp.ch [157.161.1.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A39143FCB for ; Sat, 22 Feb 2003 08:53:58 -0800 (PST) (envelope-from mb@imp.ch) Received: from levais.imp.ch (levais.imp.ch [157.161.4.66]) by mail.imp.ch (8.12.6/8.12.3) with ESMTP id h1MGrvXN038482; Sat, 22 Feb 2003 17:53:57 +0100 (CET) (envelope-from Martin.Blapp@imp.ch) Date: Sat, 22 Feb 2003 17:56:41 +0100 (CET) From: Martin Blapp To: Simon Cc: "freebsd-bugs@FreeBSD.org" , HiTech Creations Support Subject: Re: kern/39878: mysqld process suddenly runs at 99% CPU without load, and a restart of mysqld is required. In-Reply-To: <200302221536.h1MFauXM030770@mail.imp.ch> Message-ID: <20030222175014.P59307@levais.imp.ch> References: <200302221536.h1MFauXM030770@mail.imp.ch> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, > @${ECHO} " WITH_LINUXTHREADS=yes Use the linuxthreads pthread library." > @${ECHO} " This is _NOT_ recommended for production" > @${ECHO} " servers. Expect problems when enabled." I know that. It was true until now. > > what is the patch below for? Mysql did not kill it's threads when using WITH_LINUXTHREADS=yes. So you were running out of processes and fd's after some time. Quoting Rick Reed from Yahoo! > The socket on which MySQL listens for new connections on a blocking > socket most of the time but is set to non-blocking during the > accept() of the new connection. Due to a bug in the kernel, the new > socket returned by accept() is a blocking socket but returns the > O_NONBLOCK flag when queried via fcntl(F_GETFL). That is, the file > descriptor and the underlying socket don't agree on the blocking > mode. > > Since MySQL determines via fcntl(F_GETFL) that the socket is > non-blocking, it expects the first read() in my_real_read to not > block, so it doesn't enable the timeout alarm. However, the read > does block, and thus there's no timeout alarm. The thread kill > (which relies on rescheduling the timeout alarm) also does not work > as a consequence. Martin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message