[patch]socket_timeout in interfaces/libpq

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch]socket_timeout in interfaces/libpq

nagaura.ryohei@fujitsu.com
Hello all.

First, I'd like to appreciate with all your reviewing and discussion in the last CommitFest[1].

I don't think that the rest one of my proposals has been rejected completely, so I want to restart discussion.

It is a timeout parameter in interfaces/libpq.

Consider some situations where some happening occurred a server and it became significant busy. e.g., what I and Tsunakawa-san have illustrated[2][3].
These server's bad condition(i.e., non-functional server) could cause clients' infinite waiting because it is not always possible for current timeout parameters in backend side to fire.
Under such server's bad condition, control should be passed to the client after a certain period of time, and just a timeout disconnection corresponds to it.
Also, in such situations the backend parameters may not work, so we need to implement the timeout parameters on the client side.

It is preferable to implement this parameter in PQwait() where clients can wait endlessly.
However this can do unintended timeout when setting socket_timeout < statement_timeout(etc. some other timeout parameters).
Thus documentation warns this.

FYI, a similarly parameter socketTimeout is in pgJDBC[4].
Do you have any thoughts?

P.S.
Fabien-san,
I'll build another thread and let's discussion there about \c's taking care of connection parameters you have pointed out!

[1] https://www.postgresql.org/message-id/flat/EDA4195584F5064680D8130B1CA91C45367328@G01JPEXMBYT04
[2] https://www.postgresql.org/message-id/EDA4195584F5064680D8130B1CA91C45367328%40G01JPEXMBYT04
[3] https://www.postgresql.org/message-id/0A3221C70F24FB45833433255569204D1FBC7561%40G01JPEXMBYT05
[4] https://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters

Best regards,
---------------------
Ryohei Nagaura

socket_timeout.patch (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch]socket_timeout in interfaces/libpq

Michael Paquier-2
On Wed, Jun 26, 2019 at 04:13:36AM +0000, [hidden email] wrote:
> I don't think that the rest one of my proposals has been rejected
> completely, so I want to restart discussion.

I recall on the matter that there was consensus that nobody really
liked this option because it enforced a cancellation on the
connection.
--
Michael

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: [patch]socket_timeout in interfaces/libpq

nagaura.ryohei@fujitsu.com
Hi, Michael-san.

> From: Michael Paquier <[hidden email]>
> On Wed, Jun 26, 2019 at 04:13:36AM +0000, [hidden email] wrote:
> > I don't think that the rest one of my proposals has been rejected
> > completely, so I want to restart discussion.
> I recall on the matter that there was consensus that nobody really liked this option
> because it enforced a cancellation on the connection.
It seems that you did not think so at that time.
# Please refer to [1]

I don't think all the reviewers are completely negative.
I think some couldn't judge because  lack of what kind of problem I was going to solve and the way to solve it, so I restarted to describe them in this time.

[1] https://www.postgresql.org/message-id/20190406065428.GA2145%40paquier.xyz
Best regards,
---------------------
Ryohei Nagaura




Reply | Threaded
Open this post in threaded view
|

Re: [patch]socket_timeout in interfaces/libpq

Michael Paquier-2
On Wed, Jun 26, 2019 at 11:56:28AM +0000, [hidden email] wrote:
> It seems that you did not think so at that time.
> # Please refer to [1]
>
> I don't think all the reviewers are completely negative.

I recall having a negative impression on the patch when first looking
at it, and still have the same impression when looking at the last
version.  Just with a quick look, assuming that you can bypass all
cleanup operations normally taken by pqDropConnection() through a
hijacking of pqWait() is not fine as this routine explicitely assumes
to *never* have a timeout for its wait.
--
Michael

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch]socket_timeout in interfaces/libpq

Michael Paquier-2
On Tue, Sep 10, 2019 at 03:38:21PM +0900, Michael Paquier wrote:
> I recall having a negative impression on the patch when first looking
> at it, and still have the same impression when looking at the last
> version.  Just with a quick look, assuming that you can bypass all
> cleanup operations normally taken by pqDropConnection() through a
> hijacking of pqWait() is not fine as this routine explicitely assumes
> to *never* have a timeout for its wait.

By the way, Fabien, you are marked as a reviewer of this patch since
the end of June.  Are you planning to review it?
--
Michael

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch]socket_timeout in interfaces/libpq

Fabien COELHO-3

> By the way, Fabien, you are marked as a reviewer of this patch since the
> end of June.  Are you planning to review it?

Not this round.

--
Fabien.