Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea6d54e

Browse files
committed
Add "retry another address" log message on statistics collector socket
failure, to reduce confusion in the log file.
1 parent eac825a commit ea6d54e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
1515
*
16-
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.122 2006/04/06 20:38:00 tgl Exp $
16+
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.123 2006/04/20 10:51:32 momjian Exp $
1717
* ----------
1818
*/
1919
#include "postgres.h"
@@ -216,7 +216,8 @@ pgstat_init(void)
216216
struct timeval tv;
217217
char test_byte;
218218
int sel_res;
219-
219+
int tries = 0;
220+
220221
#define TESTBYTEVAL ((char) 199)
221222

222223
/*
@@ -276,6 +277,10 @@ pgstat_init(void)
276277
continue;
277278
#endif
278279

280+
if (++tries > 1)
281+
ereport(LOG,
282+
(errmsg("trying another address for the statistics collector")));
283+
279284
/*
280285
* Create the socket.
281286
*/

0 commit comments

Comments
 (0)