Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4qBM-0002U6-6L for pgsql-committers@arkaria.postgresql.org; Thu, 20 Feb 2020 18:04:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4qBJ-0007Rn-UH for pgsql-committers@arkaria.postgresql.org; Thu, 20 Feb 2020 18:04:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4qBJ-0007QR-I0 for pgsql-committers@lists.postgresql.org; Thu, 20 Feb 2020 18:04:13 +0000 Received: from smtp4-g21.free.fr ([212.27.42.4]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4qBG-0008L3-CO for pgsql-committers@lists.postgresql.org; Thu, 20 Feb 2020 18:04:12 +0000 Received: from [IPv6:2a01:e35:8be2:85e0:b0fc:a821:1fce:4e64] (unknown [IPv6:2a01:e35:8be2:85e0:b0fc:a821:1fce:4e64]) by smtp4-g21.free.fr (Postfix) with ESMTPS id 22E4819F5B0; Thu, 20 Feb 2020 19:04:00 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: pgsql: Add kqueue(2) support to the WaitEventSet API. From: =?utf-8?Q?R=C3=A9mi_Zara?= In-Reply-To: Date: Thu, 20 Feb 2020 19:03:59 +0100 Cc: Michael Paquier , Thomas Munro , pgsql-committers Content-Transfer-Encoding: quoted-printable Message-Id: <08364CCB-07F5-423E-8CE0-ABF0195C4CA2@mac.com> References: <20200220072435.GM2288@paquier.xyz> To: Thomas Munro X-Mailer: Apple Mail (2.3608.60.0.2.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > Le 20 f=C3=A9vr. 2020 =C3=A0 12:15, Thomas Munro = a =C3=A9crit : >=20 > On Thu, Feb 20, 2020 at 8:24 PM Michael Paquier = wrote: >> On Wed, Feb 05, 2020 at 04:59:10AM +0000, Thomas Munro wrote: >>> Add kqueue(2) support to the WaitEventSet API. >>>=20 >>> Use kevent(2) to wait for events on the BSD family of operating >>> systems and macOS. This is similar to the epoll(2) support added >>> for Linux by commit 98a64d0bd. >>=20 >> Worth noting this issue with the test suite of postgres_fdw for >> buildfarm animal coypu, running on NetBSD: >> = https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dcoypu&dt=3D2020-= 02-19%2023%3A01%3A01 >> +ERROR: kqueue failed: Too many open files >=20 > Hmm. So coypu just came back after 48 days, and the new kqueue() code > fails for process 19829 after successfully running 265 log lines' > worth of postgres_fdw tests, because it's run out of file > descriptors. I can see that WaitLatchOrSocket() actually could leak > an epoll/kqueue socket if WaitEventSetWait() raises an error, which is > interesting, but apparently not the explanation here because we don't > see a preceding error report. Another theory would be that this > machine has a low max_safe_fds, and NUM_RESERVED_FDS is only just > enough to handle the various sockets that postgres_fdw.sql creates and > at some point kqueue()'s demand for just one more pushed it over the > edge. =46rom the error text and a look at the man page for errno, = this > error is EMFILE (per process limit, which could be as low as 64) > rather then ENFILE (system limit). >=20 > Remi, any chance you could run gmake installcheck under > contrib/postgres_fdw on that host, to see if this is repeatable? Can > you tell us about the relevant limits? Maybe ulimit -n (for the user > that runs the build farm), and also sysctl -a | grep descriptors, > sysctl -a | grep maxfiles? Hi, Unfortunalty, coypu went offline again. I will run tests as soon as I = can bring it back up. R=C3=A9mi=