Re: Occupied port warning

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Occupied port warning
Дата
Msg-id 200506301929.08050.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: Occupied port warning  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Occupied port warning  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I wrote:
> The least thing it should do is error out if *no* TCP/IP port could
> be created while listen_addresses is set.

It's doing that now, and that should guard against the most common 
problem, namemly the port already being occupied (since all TCP/IP 
listen sockets use the same port).

Reading the comments in StreamServerPort, it seems the only problem we 
can't go fatal error everywhere is that on some systems the IPv4 and 
IPv6 sockets fight each other when bind() is called.  For the other 
failure modes, it seems that no such precautions are necessary.  In 
particular, I think we could error out in all of the following cases:

- Host or service name could not be resolved (just specify it 
numerically instead).  This would help against mistyped host names and 
misconfigured name servers.

- MaxListen exceeded (don't configure so many sockets instead).

- socket() failed

- listen() failed

I think we could also error out if we cannot create at least one listen 
socket for each entry in listen_addresses (instead of at least one 
overall).

Comments on that?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Backend working directories and absolute file paths
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Backend working directories and absolute file paths