diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-05-14 15:03:14 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-05-14 15:03:14 -0400 |
commit | d461d0502b6e20c6d4ec326ba2faec8212fd5dee (patch) | |
tree | edef6fd3a11847e2801c40f629d7ff7036317330 | |
parent | f1ca51549e9e7045a2db95a61744334f1dbb4d64 (diff) | |
download | postgresql-d461d0502b6e20c6d4ec326ba2faec8212fd5dee.tar.gz postgresql-d461d0502b6e20c6d4ec326ba2faec8212fd5dee.zip |
For testing purposes, reinsert a timeout in pgstat.c's wait call.
Test results from buildfarm members mastodon/narwhal (Windows Server 2003)
make it look like that platform just plain loses FD_READ events
occasionally, and the only reason our previous coding seemed to work was
that it timed out every couple of seconds and retried the whole operation.
Try to verify this by reinserting a finite timeout into the pgstat loop.
This isn't meant to be a permanent patch either, just to confirm or
disprove a theory.
-rw-r--r-- | src/backend/postmaster/pgstat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 4c2cc655723..a7ca8cd60d7 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -3241,10 +3241,11 @@ PgstatCollectorMain(int argc, char *argv[]) elog(LOG, "pgstat: waiting"); /* Sleep until there's something to do */ + /* XXX should not need a timeout here */ wr = WaitLatchOrSocket(&pgStatLatch, - WL_LATCH_SET | WL_POSTMASTER_DEATH | WL_SOCKET_READABLE, + WL_LATCH_SET | WL_POSTMASTER_DEATH | WL_SOCKET_READABLE | WL_TIMEOUT, pgStatSock, - -1L); + 2000L); elog(LOG, "pgstat: wait result 0x%x", wr); |