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 1l1WDB-0006un-84 for psycopg@arkaria.postgresql.org; Mon, 18 Jan 2021 15:12:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1WCe-0001jw-M7 for psycopg@arkaria.postgresql.org; Mon, 18 Jan 2021 15:12:24 +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 1l1WCe-0001jp-EC for psycopg@lists.postgresql.org; Mon, 18 Jan 2021 15:12:24 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l1WCY-00036C-B0 for psycopg@postgresql.org; Mon, 18 Jan 2021 15:12:24 +0000 Received: by mail-lj1-x233.google.com with SMTP id n11so18578449lji.5 for ; Mon, 18 Jan 2021 07:12:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P6VR/gi9zicNnxHRCf98Y0H4q7MyClIMlZux+7k+oRM=; b=uEJRZSV+llKKpuAgw7+uysnOnPVkwH8sauqGgDB/pyjhNk5syERfyXZM0BrykWPqX1 9Z7c15PYkiZLAn644FDG+PNe1bOvBtUJUO/b4+SgHO7KK9ZKCe6ORZaq0dxlvUZbXXe+ +r4vsk+mywg8GpA57IeMyQkxlnRXzW2ypyO3xLtP2aj9TVpoGaGLDA5TxJInyD7Po/Fw 357NzcUWyi9b8HjZE4tNou1fTr70LKhn3bXSTophI/POWRlS4LdfDq5l5gXnYrW7WYie jPNEBrgedhHrFX8Fq0WDa4DYwW04qT/ciAOL4XtIvSJo2W0AkrH0ndiuv7LlgB92DXbx sYhA== 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=P6VR/gi9zicNnxHRCf98Y0H4q7MyClIMlZux+7k+oRM=; b=Y6yBGAeuxTwVl4eyY5KFvTvKATi83HMX+bCDgzWReSh9GHQRb5eGkAzigGwzpei34b cDmoPxoSUxpb3weuRbDEzUMemEVHFwXQybJfHY3nanNH3yXkeCpjSquwL05vLIJ+3OUb DSdORJq84sYpPNmdV/rg0RfzHSkrpVJXb+7YNT5VyQhkS6cFX3GBS3nmNn+MHyFTGMCl 67OJznsV2a7ibfqsNcWQQgUYTIuZKN/qhjZdcyQ2hgUdmM66Fgk8Rae+KraHpsrSl6AY r34spy8cXFNE7EYWPIybf7slB6CrAaNXnBlqrLgunUC/SoPjZLjvHBgzyOzskuLsTVbu UeKA== X-Gm-Message-State: AOAM531FWixBVIjlCB1EjOZtJZO56oZJK4p9c960vWSBIdiLFbNb2V2s TOy50ghRhf58epm5UdOJ9CoF7XWAzmXVKiQpV6Q= X-Google-Smtp-Source: ABdhPJzeUkHYFH4ZAGEwQdJC6TV25Q+D4NUQH/XIxuAfBYRVq53RcEwDVD9fIB8wRxlClfsEdmv2YVi3tgoHPk/KDKM= X-Received: by 2002:a05:651c:204e:: with SMTP id t14mr45106ljo.499.1610982737056; Mon, 18 Jan 2021 07:12:17 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Varrazzo Date: Mon, 18 Jan 2021 16:12:05 +0100 Message-ID: Subject: Re: Designing a better connection pool for psycopg3 To: Magnus Hagander 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, 18 Jan 2021 at 15:39, Magnus Hagander wrote: > > On Mon, Jan 18, 2021 at 3:29 PM Daniele Varrazzo > wrote: > > I'm trying to imagine what happens in a case such as a network > > partition or reconfiguration, and the app server doesn't see the > > database anymore. This node is arguably broken. > > Only if this is the *only* thing it does. > > It might still be able to reach other services on other nodes. Other > databases. Heck, even other database son the same node if it was a > config error. In your opinion (and Karsten's, if he'd like to chip in), what should happen on program start? Is attempting to create a new connection in the main thread, and throwing an exception if failing to do so, a reasonable behaviour? Cheers, -- Daniele