Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d461d05

Browse files
committed
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.
1 parent f1ca515 commit d461d05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,10 +3241,11 @@ PgstatCollectorMain(int argc, char *argv[])
32413241
elog(LOG, "pgstat: waiting");
32423242

32433243
/* Sleep until there's something to do */
3244+
/* XXX should not need a timeout here */
32443245
wr = WaitLatchOrSocket(&pgStatLatch,
3245-
WL_LATCH_SET | WL_POSTMASTER_DEATH | WL_SOCKET_READABLE,
3246+
WL_LATCH_SET | WL_POSTMASTER_DEATH | WL_SOCKET_READABLE | WL_TIMEOUT,
32463247
pgStatSock,
3247-
-1L);
3248+
2000L);
32483249

32493250
elog(LOG, "pgstat: wait result 0x%x", wr);
32503251

0 commit comments

Comments
 (0)