Re: psql sets up cancel handler very early

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: psql sets up cancel handler very early
Дата
Msg-id CAEZATCUifDD9HBH-49TBKmJ9k6_D7Occ8B+SV1=f5JhggRsSjA@mail.gmail.com
обсуждение исходный текст
Ответ на psql sets up cancel handler very early  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On 14 May 2013 16:35, Peter Eisentraut <peter_e@gmx.net> wrote:
> Sometimes, the psql startup hangs when it cannot resolve or connect to a
> host.  Intuitively, I would like to press Ctrl+C and correct the
> connection string or investigate.  But that doesn't work because Ctrl+C
> is already bound to the query cancel handler by that time.
>
> It seems to me that there is no point in setting up the cancel handler
> before the database connection is established.  Example patch attached.
>  Comments?
>

That makes sense to me, and the patch appears to work as advertised.

The objections to the previous patch were that it did nothing in the
\c case, or if the server becomes unreachable mid-session. Those feel
like much less common cases, but maybe they're still worth thinking
about. However, IMO the solution to those issues is likely to be a
significantly different (and larger) patch.

Also, even if those issues do get addressed one day, the change in
this patch still seems like the right thing to do on initial startup,
which IME is the most common case, so +1 for this patch.

I'm marking it ready for committer.

Regards,
Dean



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Следующее
От: dlight
Дата:
Сообщение: Re: Performance problem in PLPgSQL