Skip to content

Commit 9a02dbd

Browse files
committed
Retry initial slurp_file("current_logfiles"), in test 004_logrotate.pl.
Buildfarm member topminnow failed when the test script attempted this before the syslogger would have created the file. Back-patch to v12, which introduced the test.
1 parent f5de090 commit 9a02dbd

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/bin/pg_ctl/t/004_logrotate.pl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@
2121

2222
$node->psql('postgres', 'SELECT 1/0');
2323

24-
my $current_logfiles = slurp_file($node->data_dir . '/current_logfiles');
24+
# might need to retry if logging collector process is slow...
25+
my $max_attempts = 180 * 10;
26+
27+
my $current_logfiles;
28+
for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
29+
{
30+
eval {
31+
$current_logfiles = slurp_file($node->data_dir . '/current_logfiles');
32+
};
33+
last unless $@;
34+
usleep(100_000);
35+
}
36+
die $@ if $@;
2537

2638
note "current_logfiles = $current_logfiles";
2739

@@ -34,9 +46,6 @@
3446
$lfname =~ s/^stderr //;
3547
chomp $lfname;
3648

37-
# might need to retry if logging collector process is slow...
38-
my $max_attempts = 180 * 10;
39-
4049
my $first_logfile;
4150
for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
4251
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy