Re: PGSTAT: bind(2): Can't assign requested address

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Bjoern A(dot) Zeeb" <bzeeb-lists(at)lists(dot)zabbadoz(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: PGSTAT: bind(2): Can't assign requested address
Date: 2006-04-20 10:50:27
Message-ID: 200604201050.k3KAoRd05436@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bjoern A. Zeeb wrote:
> On Fri, 7 Jun 2002, Bruce Momjian wrote:
>
> Hi,
>
> it's been some months so I left the fullquote attached.
>
> > Well, you are the first to report that 127.0.0.1 doesn't work for stats.
> > Unless someone else has a problem, I think we will leave it unchanged.
>
>
> The last years this problem was disucced several times (mostly on
> FreeBSD lists) for the reason of FreeBSD jails. I thought that we
> had another mail in 2002 about that but couldn't find it anymore.
>
> Anyway binding to 127.0.0.1 in a jail binds to the (usually public) IP
> address of that jail which means the stats socket is basically open to
> world (from the socket point of view).

Yes, but we need an interface that will drop packets on heavy load, and
a local IP is the only way we know to do that.

> Another problem (which is not a postgresql problem per se) is that if
> the system is built without inet6 support or does not support inet6
> (as in jails) but there is a ::1 localhost in /etc/hosts the error
> messages gives a warning like:
> could not create socket for statistics collector:
> Protocol not supported
> which sound annoying in first places until you find out that it worked
> anyway and remember what cuases the warning.

Yes, that is confusing. The following patch adds a message after the
error:

trying another address for the statistics collector

which should help reduce confusion. It will appear in 8.2.

> Is there any reason why you explicitly disallow a posix local socket
> at that point in backend/postmaster/pgstat.c:pgstat_init:
>
> ...
> for (addr = addrs; addr; addr = addr->ai_next)
> {
> #ifdef HAVE_UNIX_SOCKETS
> /* Ignore AF_UNIX sockets, if any are returned. */
> if (addr->ai_family == AF_UNIX)
> continue;
> #endif
> ...
>
>
> Couldn't you use/allow (if possible or configured) a posix local socket
> or even use pipes for that?

Yes, because it can't drop packets, I think.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
unknown_filename text/plain 870 bytes

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2006-04-20 10:55:48 Re: NLS vs error processing, again
Previous Message Bruce Momjian 2006-04-20 09:45:14 Re: BUG #2401: spinlocks not available on amd64