Re: Millisecond-precision connect_timeout for libpq

Поиск
Список
Период
Сортировка
От ivan babrou
Тема Re: Millisecond-precision connect_timeout for libpq
Дата
Msg-id CANWdNRCNWQ68XrXXmgC-4SbjL6PaXxrhq6wc2VbpM1pWpYJGcQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Millisecond-precision connect_timeout for libpq  (Dmitriy Igrishin <dmitigr@gmail.com>)
Список pgsql-hackers
On 9 July 2013 19:17, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
>
>
>
> 2013/7/9 Merlin Moncure <mmoncure@gmail.com>
>>
>> On Fri, Jul 5, 2013 at 12:28 PM, ivan babrou <ibobrik@gmail.com> wrote:
>> > Hi, guys! I made a quick patch to support floating number in
>> > connect_timeout param for libpq. This will treat floating number as
>> > seconds so this is backwards-compatible. I don't usually write in C,
>> > so there may be mistakes. Could you review it and give me some
>> > feedback?
>>
>> First thing that jumps into my head: why not use asynchronous
>> connection (PQconnectStart, etc) and code the timeout on top of that?
>
> +1.
>>
>>
>> merlin
>>
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
>
>
>
> --
> // Dmitriy.
>

Doesn't look like straightforward solution for me. In my case existing
drivers will benefit from my patch, in async case they should be
rewritten. We don't use  libpq directly, we use native pgsql module
from php.

Even with that, kernel can wait for milliseconds — why should we limit
precision 1000x times and reinvent milliseconds again in userspace?

--
Regards, Ian Babrou
http://bobrik.name http://twitter.com/ibobrik skype:i.babrou



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

Предыдущее
От: ivan babrou
Дата:
Сообщение: Re: Millisecond-precision connect_timeout for libpq
Следующее
От: Greg Jaskiewicz
Дата:
Сообщение: Listen/notify across clusters