Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-07-14 Thread Heikki Linnakangas
On 13.07.2012 14:35, Ryan Kelly wrote: On Mon, Jul 09, 2012 at 05:35:15PM +0900, Shigeru HANADA wrote: On Mon, Jun 25, 2012 at 9:00 PM, Ryan Kellyrpkell...@gmail.com wrote: - Copying only select() part of pqSocketPoll seems not enough, should we use poll(2) if it is supported? I did not

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-07-13 Thread Ryan Kelly
On Mon, Jul 09, 2012 at 05:35:15PM +0900, Shigeru HANADA wrote: Hi Ryan, On Mon, Jun 25, 2012 at 9:00 PM, Ryan Kelly rpkell...@gmail.com wrote: Connection attempt by \connect command could be also canceled by pressing Ctrl+C on psql prompt. In addition, I tried setting

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-07-12 Thread Heikki Linnakangas
On 09.07.2012 11:35, Shigeru HANADA wrote: Once the issues above are fixed, IMO this patch can be marked as Ready for committer. Thanks. The docs on async connections says: The connect_timeout connection parameter is ignored when using PQconnectPoll; it is the application's responsibility to

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-07-09 Thread Shigeru HANADA
Hi Ryan, On Mon, Jun 25, 2012 at 9:00 PM, Ryan Kelly rpkell...@gmail.com wrote: Connection attempt by \connect command could be also canceled by pressing Ctrl+C on psql prompt. In addition, I tried setting PGCONNECT_TIMEOUT to 0 (infinite), but psql gave up after few seconds, for both

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-06-25 Thread Ryan Kelly
Shigeru: Thank you very much for your review. Comments are inline below, and a new patch is attached. On Fri, Jun 22, 2012 at 10:06:53AM +0900, Shigeru HANADA wrote: (2012/05/01 0:30), Ryan Kelly wrote: On Mon, Apr 30, 2012 at 09:02:33AM -0400, Alvaro Herrera wrote: Well, do *you* want it?

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-06-21 Thread Shigeru HANADA
(2012/05/01 0:30), Ryan Kelly wrote: On Mon, Apr 30, 2012 at 09:02:33AM -0400, Alvaro Herrera wrote: Well, do *you* want it? Of course. That way I can stop patching my psql and go back to using the one that came with my release :) Here is result of my review of v4 patch. Submission

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-04-30 Thread Ryan Kelly
On Sun, Apr 29, 2012 at 10:12:40PM -0400, Alvaro Herrera wrote: Excerpts from Ryan Kelly's message of sáb ene 14 16:22:21 -0300 2012: I have attached a new patch which handles the connect_timeout option by adding a PQconnectTimeout(conn) function to access the connect_timeout which I

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-04-30 Thread Alvaro Herrera
Excerpts from Ryan Kelly's message of lun abr 30 07:10:14 -0400 2012: On Sun, Apr 29, 2012 at 10:12:40PM -0400, Alvaro Herrera wrote: Excerpts from Ryan Kelly's message of sáb ene 14 16:22:21 -0300 2012: I have attached a new patch which handles the connect_timeout option by adding

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-04-30 Thread Ryan Kelly
On Mon, Apr 30, 2012 at 09:02:33AM -0400, Alvaro Herrera wrote: Excerpts from Ryan Kelly's message of lun abr 30 07:10:14 -0400 2012: On Sun, Apr 29, 2012 at 10:12:40PM -0400, Alvaro Herrera wrote: Excerpts from Ryan Kelly's message of sáb ene 14 16:22:21 -0300 2012: I have

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-04-29 Thread Alvaro Herrera
Excerpts from Ryan Kelly's message of sáb ene 14 16:22:21 -0300 2012: I have attached a new patch which handles the connect_timeout option by adding a PQconnectTimeout(conn) function to access the connect_timeout which I then use to retrieve the existing value from the old connection. Was

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-01-14 Thread Ryan Kelly
On Tue, Jan 10, 2012 at 11:29:58AM +0200, Heikki Linnakangas wrote: On 09.01.2012 15:49, Ryan Kelly wrote: On Mon, Jan 09, 2012 at 10:35:50AM +0200, Heikki Linnakangas wrote: That assumes that it's safe to longjmp out of PQconnectdbParams at any instant. It's not. I'm guessing because it

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-01-10 Thread Heikki Linnakangas
On 09.01.2012 15:49, Ryan Kelly wrote: On Mon, Jan 09, 2012 at 10:35:50AM +0200, Heikki Linnakangas wrote: That assumes that it's safe to longjmp out of PQconnectdbParams at any instant. It's not. I'm guessing because it could result in a resource leak? Yes, and other unfinished business,

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-01-09 Thread Heikki Linnakangas
On 08.01.2012 22:18, Ryan Kelly wrote: @@ -1570,7 +1570,13 @@ do_connect(char *dbname, char *user, char *host, char *port) keywords[7] = NULL; values[7] = NULL; - n_conn = PQconnectdbParams(keywords, values, true); + if

Re: [HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-01-09 Thread Ryan Kelly
On Mon, Jan 09, 2012 at 10:35:50AM +0200, Heikki Linnakangas wrote: On 08.01.2012 22:18, Ryan Kelly wrote: @@ -1570,7 +1570,13 @@ do_connect(char *dbname, char *user, char *host, char *port) keywords[7] = NULL; values[7] = NULL; -n_conn =

[HACKERS] [PATCH] Allow breaking out of hung connection attempts

2012-01-08 Thread Ryan Kelly
When attempting to connect to a non-existent host with psql, the connection will hang and ^C will not break the attempt. This affects two places: startup and in interactive mode with \c. During startup, the new behavior will be to exit psql. In interactive mode, the new behavior will be to return