Skip site navigation (1) Skip section navigation (2)

Re: Occupied port warning

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Occupied port warning
Date: 2005-06-30 17:29:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 

Comments on that?

Peter Eisentraut

In response to


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2005-06-30 18:20:22
Subject: Re: Backend working directories and absolute file paths
Previous:From: David FetterDate: 2005-06-30 17:16:32
Subject: Re: Backend working directories and absolute file paths

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group