Re: Occupied port warning

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Occupied port warning
Дата
Msg-id 14965.1119968655@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Occupied port warning  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Occupied port warning  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> During a recent training session I was reminded about a peculiar 
> misbehavior that recent PostgreSQL releases exhibit when the TCP port 
> they are trying to bind to is occupied:

> LOG:  could not bind IPv4 socket: Address already in use
> HINT:  Is another postmaster already running on port 5432? If not, wait 
> a few seconds and retry.
> WARNING:  could not create listen socket for "localhost"

> The trainees found this behavior somewhat unuseful.

What behavior are you proposing, exactly?

I don't think it's practical to make the server error out if it can't
bind to every socket it tries to bind to --- that will leave you dead
in the water in an uncomfortably large number of scenarios.  I think
the cases that forced us to adopt this behavior originally were ones
where userland thinks IPv6 is supported but the kernel does not.
Thus, we can *not* treat the list returned by getaddrinfo as gospel.

It might be reasonable to treat some error conditions as fatal but
not others.  But you'd have to engage in pretty close analysis to
make sure you weren't buying into any bad behaviors.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Implementing SQL/PSM for PG 8.2 - debugger
Следующее
От: Tom Lane
Дата:
Сообщение: Re: #ifdef NOT_USED