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 1l1V9r-0004OH-Vb for psycopg@arkaria.postgresql.org; Mon, 18 Jan 2021 14:05:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1V9q-0005t3-DM for psycopg@arkaria.postgresql.org; Mon, 18 Jan 2021 14:05:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1V9q-0005sw-8G for psycopg@lists.postgresql.org; Mon, 18 Jan 2021 14:05:26 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l1V9m-0002Ux-5w for psycopg@postgresql.org; Mon, 18 Jan 2021 14:05:25 +0000 Received: by mail-lf1-x12d.google.com with SMTP id o17so24253393lfg.4 for ; Mon, 18 Jan 2021 06:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tmHagWMJVRAYNz0GRHZV/QQzgxBsVboWzY+ycbzH730=; b=oLsNstLjtalhSYUG/IF4eNSblUkCyOkXMkIUVkPeGY5/Odbx7hdyUbusypTRbtsf0F hXLPTVcoZBwmIqbjSzSQ+w8VSfKCdWralTHbPAW3Os8ZJ70OKjALogXRVEWEC0p5n6Wq B8npYIvY+FKuXiw76sCyUXqWs0TOyDDq+/2a4NoM9rMuxYCqt10EhRjSCrpa8yHMMw90 UuPW9Slh9KdrG8BbSYQXXxYX35yb/X90vWMaWMjZZb/z8eDRPJy/0JJSn1bNSFIeQfKT JP8W5HbjxgMB9VITjh+QQTRAthOYYVV2Jru3on1tCVk1BPxqJwHX5GuxG/a9DRqwhd1D qJIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tmHagWMJVRAYNz0GRHZV/QQzgxBsVboWzY+ycbzH730=; b=AQvoY53VjhaPfqZUw4MZ5KvJSy8L361sfomvLjZoAb9TrVd+1bk72G0pJ0gdjO31vt XXMtyFdCpQaX3E/1FFtWK3Yfp9GBAKSdocTna0v0axXhMq2FctNIBVGui1WK3F3AmU16 CZw04b3JjS8nJW5WFNH6J2zZigqlM1zZOeF0XgItQ2IRIvc5TO5ylNHhdzOpoDFDz7GM 1Vs59UCUCVjtfvxDdlkVkerkeuZ2qlVd8U0zRK+6sJ/Oy7XKtPGmNy+e5gsFnO+IwtRG Yfm1Xnjeae9uIMD8bc92KieAYjYd2ZqDhCCtiS3GgZsxDnQvN/C2x3N3ocKf/hJeMciG tr5w== X-Gm-Message-State: AOAM531UITK0+JwgUKbkZsHyF9hqxZg6uFd+bkR+Eb76JBCAxkJroV1j 59ZPnbkG6G/B97TJ41iuoWt2l/+/BrpM3/1td/eZAw== X-Google-Smtp-Source: ABdhPJy95UxoCYNqwIPB6teotNF0duLz0sZlXkA1QnLuS3YbIYY4Zx/a3v65jUH3j5bo9cex7yWwg9i8inx/JIRZdEo= X-Received: by 2002:a19:e8a:: with SMTP id 132mr10761985lfo.108.1610978721683; Mon, 18 Jan 2021 06:05:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Magnus Hagander Date: Mon, 18 Jan 2021 15:05:10 +0100 Message-ID: Subject: Re: Designing a better connection pool for psycopg3 To: Daniele Varrazzo Cc: psycopg@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jan 18, 2021 at 2:50 PM Daniele Varrazzo wrote: > > On Mon, 18 Jan 2021 at 14:13, Karsten Hilbert wrote: > > > I would strongly advise against making sys.exit() the default > > for pool.terminate() unless I misunderstand something. > > How would you terminate the program if a maintenance thread, not the > main one, thinks that the program is not in working state? Why would it be OK for a maintenance thread to terminate the program at all? And certainly by default? Wouldn't the reasonable thing to do be to flag the pool as broken, and then just stop trying. Then whenever the application makes an attempt to use the pool, it can he thrown an exception saying that this happened. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/