Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified
От
Tsunakawa, Takayuki
Тема
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified
Дата
Msg-id
0A3221C70F24FB45833433255569204D1F6F9873@G01JPEXMBYT05
Ответ на
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified (Michael Paquier)
Список
Дерево обсуждения
[HACKERS] [doc fix] PG10: wroing description on connect_timeout when multiplehosts are specified "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
[HACKERS] Re: [doc fix] PG10: wroing description on connect_timeout whenmultiple hosts are specified "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
[HACKERS] Re: [doc fix] PG10: wroing description on connect_timeout whenmultiple hosts are specified "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
[HACKERS] Re: [doc fix] PG10: wroing description on connect_timeout whenmultiple hosts are specified Noah Misch <noah@leadboat.com>
[HACKERS] Re: [doc fix] PG10: wroing description on connect_timeout whenmultiple hosts are specified Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description on connect_timeout when multiple hosts are specified Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Re: [doc fix] PG10: wroing description onconnect_timeout when multiple hosts are specified Michael Paquier <michael.paquier@gmail.com>
From: pgsql-hackers-owner@postgresql.org > [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Michael Paquier > pqWait is internal to libpq, so we are free to set up what we want here. > Still I think that we should be consistent with what pqSocketCheck returns: Please let this what it is now for the same reason Robert mentioned. > + int ret = 0; > + int timeout = 0; > The declaration of "ret" should be internal in the for(;;) loop. Done. > + /* Attempt connection to the next host, starting the > connect_timeout timer */ > + pqDropConnection(conn, true); > + conn->addr_cur = conn->connhost[conn->whichhost].addrlist; > + conn->status = CONNECTION_NEEDED; > + finish_time = time(NULL) + timeout; > + } > I think that it would be safer to not set finish_time if > conn->connect_timeout is NULL. I agree that your code works because > pqWaitTimed() will never complain on timeout reached if finish_time is -1. > That's for robustness sake. Done, but I'm not sure how this contributes to the robustness. I guess you were concerned just in case pqWaitTimed() returned 0 (timeout) even when it should not. Regards Takayuki Tsunakawa -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
В списке pgsql-hackers по дате отправления
От: Peter Eisentraut
Дата: