Re: libpq: Which functions may hang due to network issues?

2021-12-06 Thread Daniel Frey
On 5. Dec 2021, at 21:32, Daniel Frey wrote: > >> On 5. Dec 2021, at 17:01, Tom Lane wrote: >> >> Daniel Frey writes: >>> With all that said, I think that PostgreSQL/libpq should have a clear, >>> documented way to get rid of a connection that is guaranteed to not hang. >>> It has something

Re: libpq: Which functions may hang due to network issues?

2021-12-05 Thread Daniel Frey
> On 5. Dec 2021, at 17:01, Tom Lane wrote: > > Daniel Frey writes: >> With all that said, I think that PostgreSQL/libpq should have a clear, >> documented way to get rid of a connection that is guaranteed to not hang. It >> has something similar for almost all other methods like opening conne

Re: libpq: Which functions may hang due to network issues?

2021-12-05 Thread Tom Lane
Daniel Frey writes: > With all that said, I think that PostgreSQL/libpq should have a clear, > documented way to get rid of a connection that is guaranteed to not hang. It > has something similar for almost all other methods like opening connections, > sending request, retrieving results. Why s

Re: libpq: Which functions may hang due to network issues?

2021-12-05 Thread Daniel Frey
> On 4. Dec 2021, at 22:43, Laurenz Albe wrote: > > On Fri, 2021-12-03 at 21:33 +0100, Daniel Frey wrote: >> But the real issue, at least for me, is PQfinish(). Considering that my >> application is not >> allowed to hang (or crash, leak, ...), what should I do in case of a timeout? > > I am te

Re: libpq: Which functions may hang due to network issues?

2021-12-04 Thread Laurenz Albe
On Fri, 2021-12-03 at 21:33 +0100, Daniel Frey wrote: > But the real issue, at least for me, is PQfinish(). Considering that my > application is not > allowed to hang (or crash, leak, ...), what should I do in case of a timeout? I am tempted to say that you shouldn't use TCP with the requirement

Re: libpq: Which functions may hang due to network issues?

2021-12-03 Thread Daniel Frey
> On 3. Dec 2021, at 18:14, Tom Lane wrote: > > Daniel Frey writes: >>> On 3. Dec 2021, at 17:00, Laurenz Albe wrote: >>> On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote: Is there a complete list of methods that might wait for network communication? > >>> No; you have to read t

Re: libpq: Which functions may hang due to network issues?

2021-12-03 Thread Tom Lane
Daniel Frey writes: >> On 3. Dec 2021, at 17:00, Laurenz Albe wrote: >> On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote: >>> Is there a complete list of methods that might wait for network >>> communication? >> No; you have to read the code. > I feel that this is insufficient, as the code

Re: libpq: Which functions may hang due to network issues?

2021-12-03 Thread Daniel Frey
> On 3. Dec 2021, at 17:00, Laurenz Albe wrote: > > On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote: >> I need to know which functions of libpq may "hang", depending on network >> issues. For some functions is >> seems to be clear, as they only work locally, other functions are clearly >>

Re: libpq: Which functions may hang due to network issues?

2021-12-03 Thread Laurenz Albe
On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote: > I need to know which functions of libpq may "hang", depending on network > issues. For some functions is > seems to be clear, as they only work locally, other functions are clearly > documented to wait on some > network interaction. But for

libpq: Which functions may hang due to network issues?

2021-12-03 Thread Daniel Frey
I need to know which functions of libpq may "hang", depending on network issues. For some functions is seems to be clear, as they only work locally, other functions are clearly documented to wait on some network interaction. But for some functions, it is unclear on whether they are guaranteed to