Re: ssl tests aren't concurrency safe due to get_free_port()

2023-05-04 Thread Peter Eisentraut
On 05.05.23 00:33, Andrew Dunstan wrote: On 2023-05-04 Th 02:40, Peter Eisentraut wrote: On 25.04.23 12:27, Peter Eisentraut wrote: On 20.11.22 16:10, Andrew Dunstan wrote: On 2022-11-19 Sa 15:16, Andres Freund wrote: Hi, On 2022-11-19 10:56:33 -0500, Andrew Dunstan wrote: Perhaps we shoul

Re: ssl tests aren't concurrency safe due to get_free_port()

2023-05-04 Thread Andrew Dunstan
On 2023-05-04 Th 02:40, Peter Eisentraut wrote: On 25.04.23 12:27, Peter Eisentraut wrote: On 20.11.22 16:10, Andrew Dunstan wrote: On 2022-11-19 Sa 15:16, Andres Freund wrote: Hi, On 2022-11-19 10:56:33 -0500, Andrew Dunstan wrote: Perhaps we should just export a directory in configure ins

Re: ssl tests aren't concurrency safe due to get_free_port()

2023-05-03 Thread Peter Eisentraut
On 25.04.23 12:27, Peter Eisentraut wrote: On 20.11.22 16:10, Andrew Dunstan wrote: On 2022-11-19 Sa 15:16, Andres Freund wrote: Hi, On 2022-11-19 10:56:33 -0500, Andrew Dunstan wrote: Perhaps we should just export a directory in configure instead of this guessing game? I think the obvious

Re: ssl tests aren't concurrency safe due to get_free_port()

2023-05-01 Thread Peter Eisentraut
On 25.04.23 12:27, Peter Eisentraut wrote: These patches have affected pgxs-using extensions that have their own TAP tests. The portlock directory is created at     my $build_dir = $ENV{top_builddir}   || $PostgreSQL::Test::Utils::tmp_check ;     $portdir ||= "$build_dir/portlock"; but

Re: ssl tests aren't concurrency safe due to get_free_port()

2023-04-25 Thread Peter Eisentraut
On 20.11.22 16:10, Andrew Dunstan wrote: On 2022-11-19 Sa 15:16, Andres Freund wrote: Hi, On 2022-11-19 10:56:33 -0500, Andrew Dunstan wrote: Perhaps we should just export a directory in configure instead of this guessing game? I think the obvious candidate would be to export top_builddir fr

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-23 Thread Andrew Dunstan
On 2022-11-22 Tu 20:36, Tom Lane wrote: > Andres Freund writes: >> While looking into a weird buildfarm failure ([1]), I noticed this: >> # Checking port 62707 >> Use of uninitialized value $pid in scalar chomp at >> /mnt/resource/bf/build/grassquit/REL_11_STABLE/pgsql.build/../pgsql/src/test/p

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-22 Thread Andrew Dunstan
> On Nov 22, 2022, at 8:36 PM, Tom Lane wrote: > > Andres Freund writes: >> While looking into a weird buildfarm failure ([1]), I noticed this: > >> # Checking port 62707 >> Use of uninitialized value $pid in scalar chomp at >> /mnt/resource/bf/build/grassquit/REL_11_STABLE/pgsql.build/../p

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-22 Thread Tom Lane
Andres Freund writes: > While looking into a weird buildfarm failure ([1]), I noticed this: > # Checking port 62707 > Use of uninitialized value $pid in scalar chomp at > /mnt/resource/bf/build/grassquit/REL_11_STABLE/pgsql.build/../pgsql/src/test/perl/PostgresNode.pm > line 1247. > Use of unin

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-22 Thread Andres Freund
Hi, On 2022-11-22 10:57:41 -0500, Andrew Dunstan wrote: > On 2022-11-20 Su 14:05, Andres Freund wrote: > >> If it works ok I will backpatch in couple of days. > > +1 > Done. While looking into a weird buildfarm failure ([1]), I noticed this: # Checking port 62707 Use of uninitialized value $pid

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-22 Thread Andrew Dunstan
On 2022-11-20 Su 14:05, Andres Freund wrote: >> If it works ok I will backpatch in couple of days. > +1 Done. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-20 Thread Andres Freund
On 2022-11-20 10:10:38 -0500, Andrew Dunstan wrote: > OK, pushed with a little more tweaking. Thanks! > I didn't upcase top_builddir > because the existing prove_installcheck recipes already export it and I > wanted to stay consistent with those. Makes sense. > If it works ok I will backpatch

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-20 Thread Andrew Dunstan
On 2022-11-19 Sa 15:16, Andres Freund wrote: > Hi, > > On 2022-11-19 10:56:33 -0500, Andrew Dunstan wrote: >>> Perhaps we should just export a directory in configure instead of this >>> guessing game? >> I think the obvious candidate would be to export top_builddir from >> src/Makefile.global. Th

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-19 Thread Andres Freund
Hi, On 2022-11-19 10:56:33 -0500, Andrew Dunstan wrote: > > Perhaps we should just export a directory in configure instead of this > > guessing game? > > I think the obvious candidate would be to export top_builddir from > src/Makefile.global. That would remove the need to infer it from > TESTDAT

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-19 Thread Andrew Dunstan
On 2022-11-15 Tu 20:51, Andres Freund wrote: >> @@ -140,6 +143,27 @@ INIT >> >> # Tracking of last port value assigned to accelerate free port lookup. >> $last_port_assigned = int(rand() * 16384) + 49152; >> + >> +# Set the port lock directory >> + >> +# If we're told to use a

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 15:56:37 -0500, Andrew Dunstan wrote: > On 2022-11-06 Su 11:30, Andrew Dunstan wrote: > > > > One possible addition would be to add removing the reservation files in > > an END handler. That would be pretty simple. > > > > > > > Here's a version with that. I suggest we try it o

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-15 Thread Andrew Dunstan
On 2022-11-06 Su 11:30, Andrew Dunstan wrote: > > One possible addition would be to add removing the reservation files in > an END handler. That would be pretty simple. > > Here's a version with that. I suggest we try it out and see if anything breaks. cheers andrew -- Andrew Dunstan EDB: h

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-06 Thread Andrew Dunstan
On 2022-11-05 Sa 14:36, Andres Freund wrote: >> >> use Carp; >> use Config; >> -use Fcntl qw(:mode); >> +use Fcntl qw(:mode :flock :seek O_CREAT O_RDWR); > Does this do anything useful on windows? All we're doing here on Windows and elsewhere is getting access to some constants used in call

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-05 Thread Andres Freund
Hi, On 2022-11-03 14:16:51 -0400, Andrew Dunstan wrote: > > Here's a patch which I think does the right thing. > Updated with a couple of thinkos fixed. Thanks! > diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm > b/src/test/perl/PostgreSQL/Test/Cluster.pm > index d80134b26f..aceca353d3 1

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-03 Thread Andrew Dunstan
On 2022-11-02 We 15:09, Andrew Dunstan wrote: > On 2022-10-17 Mo 10:59, Andrew Dunstan wrote: >> On 2022-10-04 Tu 01:39, Andrew Dunstan wrote: >>> On 2022-10-02 Su 12:49, Andres Freund wrote: 2) Use a lockfile containing a pid to protect the choice of a port within a build directory.

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-02 Thread Andrew Dunstan
On 2022-10-17 Mo 10:59, Andrew Dunstan wrote: > On 2022-10-04 Tu 01:39, Andrew Dunstan wrote: >> On 2022-10-02 Su 12:49, Andres Freund wrote: >>> 2) Use a lockfile containing a pid to protect the choice of a port within a >>>build directory. Before accepting a port get_free_port() would check

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-10-17 Thread Andrew Dunstan
On 2022-10-04 Tu 01:39, Andrew Dunstan wrote: > On 2022-10-02 Su 12:49, Andres Freund wrote: >> 2) Use a lockfile containing a pid to protect the choice of a port within a >>build directory. Before accepting a port get_free_port() would check if >> the >>a lockfile exists for the port an

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-10-03 Thread Andrew Dunstan
On 2022-10-02 Su 12:49, Andres Freund wrote: > > 2) Use a lockfile containing a pid to protect the choice of a port within a >build directory. Before accepting a port get_free_port() would check if the >a lockfile exists for the port and if so, if the test using it is still >alive. T

ssl tests aren't concurrency safe due to get_free_port()

2022-10-02 Thread Andres Freund
Hi, See e.g. https://cirrus-ci.com/task/4682373060100096 2022-10-01 15:15:21.849 UTC [41962][postmaster] LOG: could not bind IPv4 address "127.0.0.1": Address already in use 2022-10-01 15:15:21.849 UTC [41962][postmaster] HINT: Is another postmaster already running on port 57003? If not, wait