public inbox for [email protected]  
help / color / mirror / Atom feed
From: Magnus Hagander <[email protected]>
To: Daniele Varrazzo <[email protected]>
Cc: [email protected]
Subject: Re: Designing a better connection pool for psycopg3
Date: Mon, 18 Jan 2021 16:20:18 +0100
Message-ID: <CABUevEy7xvvmBjTLGuQ5R3nETK5SURsS1UswgNT9iCF0VUJZpg@mail.gmail.com> (raw)
In-Reply-To: <CA+mi_8aMCUW873qcN1vghtMQEXX78vSLj5+LtO5dQyy_2rbbeg@mail.gmail.com>
References: <CA+mi_8aZQXzB8Kr4V0nps3aMQ74N72uWC=pZF0P1H7AW4GLasA@mail.gmail.com>
	<[email protected]>
	<CA+mi_8a-0Wx62eziOBwp-=ryBynsqrgx4AcBGW5+pSr3vZXjHg@mail.gmail.com>
	<CABUevExMQQB3=xShPie+XR04kctiR8-P_BEUz1BmCyDLhU_yhg@mail.gmail.com>
	<CA+mi_8a83=Qy-Ym+_X4tLPcD1YHVVVYF2Ki5jeHU4eDz_etG5w@mail.gmail.com>
	<CABUevEy6iYxAgH6qFJN5OqiPFkv1O1JU90jbHna2xDXqFDLFHg@mail.gmail.com>
	<CA+mi_8aMCUW873qcN1vghtMQEXX78vSLj5+LtO5dQyy_2rbbeg@mail.gmail.com>

On Mon, Jan 18, 2021 at 4:12 PM Daniele Varrazzo
<[email protected]> wrote:
>
> On Mon, 18 Jan 2021 at 15:39, Magnus Hagander <[email protected]> wrote:
> >
> > On Mon, Jan 18, 2021 at 3:29 PM Daniele Varrazzo
> > <[email protected]> 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?

Yes, I think that's perfectly reasonable.

The application is always going to have to be ready to get an
exception on the call to get a connection out of the pool. If it cares
about the "early startup failure", it should just try to grab a
connection immediately on startup and will then notice if it fails.


-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/





view thread (19+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Designing a better connection pool for psycopg3
  In-Reply-To: <CABUevEy7xvvmBjTLGuQ5R3nETK5SURsS1UswgNT9iCF0VUJZpg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox