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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ssl tests aren't concurrency safe due to get_free_port()
Date: 2022-11-23 01:36:06
Message-ID: 3617324.1669167366@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> 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 uninitialized value $pid in addition (+) at /mnt/resource/bf/build/grassquit/REL_11_STABLE/pgsql.build/../pgsql/src/test/perl/PostgresNode.pm line 1248.

Yeah, my animals are showing that too.

> Not quite sure how $pid ends up uninitialized, given the code:
> # see if someone else has or had a reservation of this port
> my $pid = <$portfile>;
> chomp $pid;
> if ($pid +0 > 0)

I guess the <$portfile> might return undef if the file is empty?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-11-23 01:42:24 odd buildfarm failure - "pg_ctl: control file appears to be corrupt"
Previous Message John Naylor 2022-11-23 01:35:06 Re: Prefetch the next tuple's memory during seqscans