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

Re: Brittleness in regression test setup

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Brittleness in regression test setup
Date: 2008-11-27 11:56:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Peter Eisentraut wrote:
> Peter Eisentraut wrote:
>> Alvaro Herrera wrote:
>>> Is it possible to make it retry in case the chosen port is busy?  I
>>> guess a simple check should suffice, ignoring the obvious race condition
>>> that someone uses the port after you checked it was OK.
>> Well, the whole point of this exercise was to avoid that.  If we had a  
>> way to do a "simple check", we might as well stick to the hardcoded 
>> port and count up from that or something.
> Well, duh, the checking is actually pretty simple.  We just try to  
> connect with psql to the candidate port number before starting our own  
> postmaster and see if anyone is already there.

But what if something else is using the port?  I think you could attempt
a bare connect().

Note typo here:

> +					fprintf(stderr, _("Specify an used port using the --port option or shut down any conflicting PostgreSQL servers.\n"));

Should say "an unused port"

Alvaro Herrera                      
The PostgreSQL Company - Command Prompt, Inc.

In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2008-11-27 12:00:39
Subject: Re: Thread safety
Previous:From: Zdenek KotalaDate: 2008-11-27 11:55:45
Subject: Re: [WIP] In-place upgrade

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