Keepalives win32

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Keepalives win32
Дата
Msg-id AANLkTimuEW4cepAAsh9pX_0SEr_glui9XhSDmium5gVX@mail.gmail.com
обсуждение исходный текст
Ответы Re: Keepalives win32  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Keepalives win32  (Andrew Chernow <ac@esilo.com>)
Список pgsql-hackers
Hi!

I'm looking at adding win32 support for keepalives in libpq (well,
also backend, but libpq for now), per the request from Robert Haas.
I've come up with one issue though - in Windows, you can only set the
"idle" and "interval" parameter together in a single syscall (in Unix,
you have one for each). There is no support for setting the counter at
all.

However, there is no API for *reading* the current value, nor the
default value. There is no way to specify "set the default". If we set
one of them to zero, it really means zero - no interval at all (so
it'll flood out the packets - really fun when you enable it for
keepalive_idle).

The default value for these are available in the registry only.

The way I see it, we have two options:
1) Read the default value from the registry. That's some fairly ugly code, imho.
2) Ignore the registry value and use the default value of 2 hours/1
second. That will override any changes the user made in the registry,
which seems pretty ugly.
3) Require that these two parameters are always specified together (on
windows). Which is annoying.

Not sure which one to pick - opinions?


The API used is documented at:
http://msdn.microsoft.com/en-us/library/dd877220(v=VS.85).aspx
Patch as it looks now (libpq only, and with obvious problems with this
issue): http://github.com/mhagander/postgres/compare/master...win32keepalive

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Admission Control
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Keepalive for max_standby_delay