Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1VlY-0005qq-0E for psycopg@arkaria.postgresql.org; Mon, 18 Jan 2021 14:44:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1VlW-0000hz-Uy for psycopg@arkaria.postgresql.org; Mon, 18 Jan 2021 14:44:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1VlW-0000hs-Q8; Mon, 18 Jan 2021 14:44:22 +0000 Received: from mout.gmx.net ([212.227.17.22]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1VlU-00084U-LO; Mon, 18 Jan 2021 14:44:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610981057; bh=I2iMYOUGaLnJTAoXc3JUhhiGKmLILvTlHvwnD60BObQ=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=fYpDwvGv0IaIcr1h8DaSFAiywssDanPAsIWGuPRi2ceduytOYl11scY4xmYbmMVbS zHqmDTQ/3XiCi+RQnEacYmlI7l57V9cb2BZWyp6V1bzj544kTNhynpuo1Td44l5mv1 fXwYjgCTXsqZqdHBZFMDvY+qShv0DNZyFir5OxkY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([89.12.167.206]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MKbg4-1lKGXV0sUm-00KwUa; Mon, 18 Jan 2021 15:44:17 +0100 Received: from ncq by hermes with local (Exim 4.94) (envelope-from ) id 1l1VlQ-0002ER-0d; Mon, 18 Jan 2021 15:44:16 +0100 Date: Mon, 18 Jan 2021 15:44:15 +0100 From: Karsten Hilbert To: psycopg@lists.postgresql.org, psycopg@postgresql.org Subject: Re: Designing a better connection pool for psycopg3 Message-ID: Mail-Followup-To: psycopg@lists.postgresql.org, psycopg@postgresql.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:o+l+eaSZm1ROXLGU8H/fN0elQgHc+qyHDqmMAwWXxwM6RgPzlgp 3xivAdHreOBFetXGdP4K6ZRmJrIoT42Uc2rbZ/mqtHwq7cS0c1GpmtoMGXqTJQrLfeT/Ayl bdEqCDJlPv40HpXN1ZUMWAvcs/lvPS7Qo6HDLCHCr1c0NemabXQ2fW6dRVZDkzM2jewFl/9 yDG95MXnJ+tuu+pZJoFuw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:cqPG2O3X6cs=:4pD5Fhmi60eDp3pU1TeaC/ 4H6q7fEY6n2i3LMBrbN+EEHkLRALssWscoaRR1odKj+uyYEga7pQpAKtGuCAhPFCpP5xpidR6 3Pd1shkAb7hA/MIhJGTpdzuJFD/WukFrQ/n4ERs1TI0y8pvZ0RzS4DyHk0SvLU+tadec381OU KczjUoWpC4lbucZHNiviI21UZdklpEExVEzC0h4QFvUpEY1MtoNF+MBv+NHC6OYL2pMl7SH2K +RJx9WN6Ky50KQcYg98uZaYn2ADD0e0rvErSETFSWTOwwuvhBYJW/wmwsyXrZQl8T6wkgP/kS +mcte9MhjRuSLa2xZKpkPyGl8AVD2ha+mQRPUga5xtyjPhcOxYGj0HUFIoM7FA94ZVYsI9sDu l78CeO+5MVRY6oj9POeDbVZlfUqsPGCO5FbXEhE+LGuPuMNSF51LYEpx6L60C3AOvYmrjV6oP YAJgfH7KLG5ncHgRRQLOMGNRAk+tDwuO4dTXT7C32lQltb0df4lwrWYlggW1ljAdbLjskrlXA MWFfrrFDvxMQ2EGWFxxtS5XVn9epLZZLg+9vz123e+hnBE+zC0uqrE3xfdAv+du4CySL4+UcG /yXXI2r7zKcAjxmRpkJEuqwfDTPr1qvYqVwL7ZN9iyHIkdP5Cx1wFzic4QESO64djZs+YHhEx Nb6NQjEZaKlghxt5mj3uBU98p0dvCgQeJ8Wr+kAYDQnjU5IvT5Io++jJQOVqf8P58AN1Ck5kn GSffCUwVDGhq3sfixrnA5ydEFe4zp4pQeaOPEfbAaW3a0ZxewhliunVpD6BuqP6651sPNU2CY RZAG9tc6lx5l/EVVrjBZOxVguSVowDUQscvuGtnAfT/gigVLzYloCTe2cAo/TZugHvBrqmtu6 aw3oTf9IIBEunG/tr65g== Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am Mon, Jan 18, 2021 at 03:39:20PM +0100 schrieb Magnus Hagander: > > Anyway I appreciate that the default of terminating a program is > > probably too aggressive. So I would remove the `terminate()` function > > and base implementation and leave a `connection_failed()` handler, > > with a default no-op implementation, which people preferring their > > program to terminate can subclass (with `sys.exit(1)` or whatever > > termination strategy they find useful). > > That would definitely work. A plugin-point for this would be very useful= . > > And if you want to avoid the "timeout based error" in the client, > adding a flag to the pool saying "this pool is currently unhealthy" in > this case would work, and then whenever someone tries to get a > connection out of this pool it can throw an exception immediately > instead of waiting for a timeout to happen. +1 :-) Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B