1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Increase process timeout and emit occasional warnings.

Travis will timeout after 10 minutes with no output.  Emit a warning every 5 minutes to keep Travis alive and increase the total timeout to 20 minutes.

Documentation builds have been timing out a lot recently so hopefully this will help.
This commit is contained in:
David Steele
2019-09-10 12:29:36 -04:00
parent e043c6b1bc
commit f8d0574759
+12 -3
View File
@@ -107,7 +107,8 @@ sub begin
new pgBackRest::Common::Io::Handle('exec test', $self->{hError}), 0, 65536);
# Record start time and set process timeout
$self->{iProcessTimeout} = 540;
$self->{iProcessTimeout} = 300;
$self->{iProcessTimeoutTotal} = 4;
$self->{lTimeLast} = time();
if (!defined($self->{hError}))
@@ -147,8 +148,16 @@ sub endRetry
# Error if process has been running longer than timeout
if (time() - $self->{lTimeLast} > $self->{iProcessTimeout})
{
confess &log(ASSERT,
"timeout after $self->{iProcessTimeout} seconds waiting for process to complete: $self->{strCommand}");
if ($self->{iProcessTimeoutTotal} > 0)
{
&log(WARN, "process has been running for $self->{iProcessTimeout} seconds with no output");
$self->{iProcessTimeoutTotal}--;
$self->{lTimeLast} = time();
}
else
{
confess &log(ASSERT, "timeout waiting for process to complete: $self->{strCommand}");
}
}
# Drain the stdout stream and look for test points