Skip site navigation (1) Skip section navigation (2)

Keepalives win32

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Keepalives win32
Date: 2010-06-28 18:23:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

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

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

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:
Patch as it looks now (libpq only, and with obvious problems with this

 Magnus Hagander


pgsql-hackers by date

Next:From: Tom LaneDate: 2010-06-28 18:26:19
Subject: Re: Keepalive for max_standby_delay
Previous:From: Kevin GrittnerDate: 2010-06-28 18:06:45
Subject: Re: Admission Control

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group