From: | Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net> |
---|---|
To: | psycopg(at)lists(dot)postgresql(dot)org, psycopg(at)postgresql(dot)org |
Subject: | Re: Designing a better connection pool for psycopg3 |
Date: | 2021-01-18 14:44:15 |
Message-ID: | YAWevy8n7/CA0o7I@hermes.hilbert.loc |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
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
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
From | Date | Subject | |
---|---|---|---|
Next Message | Daniele Varrazzo | 2021-01-18 15:12:05 | Re: Designing a better connection pool for psycopg3 |
Previous Message | Daniele Varrazzo | 2021-01-18 14:43:54 | Re: Designing a better connection pool for psycopg3 |