stats collector "connection refused" on recv of test message - Mailing list pgsql-hackers

From Steve Singer
Subject stats collector "connection refused" on recv of test message
Date
Msg-id BLU0-SMTP9739D081520290D95C2665ACC20@phx.gbl
Whole thread Raw
Responses Re: stats collector "connection refused" on recv of test message
List pgsql-hackers
On one of my machines I get

LOG:  could not receive test message on socket for statistics collector: Connection refused

on startup.  I noticed this testing 9.0 but when I went back to check I'm 
now getting it on 8.3 as well, disabling all of my iptables rules doesn't 
help.

I've done some debugging and the recv() call for reading the test message in 
pgstat.c is returning -1 with ernno set to 111 (connection refused) as the 
log message indicates.   The previous calls on PgStatSocket all seemed to 
work fine (including the send and select).

If I modify pgstat.c so that it uses pgStatSock for the bind() and receive 
but a second socket structure for the connect() and send() everything seems 
to work fine (I modify both the send calls for both the 'test' message and 
the real stats messages).

Someone else recently reported this error on -admin here 
http://archives.postgresql.org/pgsql-admin/2010-04/msg00109.php but the 
through sort of stopped.

Is using a single UDP socket structure instance for sending a message to 
yourself 'proper'? (it looks like we've been doing this in pgstat.c for 
many years without issues reported).

This machine is a 32bit powerpc running Debian linux with kernel 2.6.22 and 
glibc 2.7-18 installed.  I'm wondering if something was changed in the linux 
kernel to break this.

Steve





pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: beta3 & the open items list
Next
From: Peter Geoghegan
Date:
Subject: Re: extensible enum types