Sloppy port assignment in src/test/ldap/

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Sloppy port assignment in src/test/ldap/
Дата
Msg-id 25124.1568052346@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
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:57797ldaps://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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Does PostgreSQL support debian Linux on Arm CPU Platform?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_regress restart cluster?