pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Subject: Sloppy port assignment in src/test/ldap/
Date: Mon, 09 Sep 2019 14:05:46 -0400
Message-ID: <25124.1568052346@sss.pgh.pa.us> (raw)

I wondered about this transient failure:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=crake&dt=2019-09-09%2008%3A48%3A25

The only information that was captured was

# Running: /usr/sbin/slapd -f /home/bf/bfr/root/HEAD/pgsql.build/src/test/ldap/tmp_check/slapd.conf -h ldap://localhost:57797 ldaps://localhost:57798
Bail out!  system /usr/sbin/slapd failed

So, slapd failed without writing anything to stderr *or* its configured
log file, which is pretty unhelpful.  But, casting about for a possible
explanation, I noticed the port setup code earlier in the script:

my $ldap_port     = get_free_port();
my $ldaps_port    = $ldap_port + 1;

Translated: we're finding one free port and just assuming that
the next one will be free (or even exists :-().

Sure enough, I can reproduce the failure seen on crake if I force
the $ldaps_port to be a port number that something has in use.
Presumably that transient failure occurred because something was
using 57798.

So this code needs to be

my $ldap_port     = get_free_port();
my $ldaps_port    = get_free_port();

I'll go fix that in a moment.

			regards, tom lane





Message-ID: <25124.1568052346@sss.pgh.pa.us>
Permalink:  ../25124.1568052346@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25124.1568052346@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: Sloppy port assignment in src/test/ldap/
  In-Reply-To: <25124.1568052346@sss.pgh.pa.us>
  References: <25124.1568052346@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox