1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-12-01 22:30:09 +02:00

Fixed timeout issue.

The protocol-timeout option was not automatically increased when the db-timeout option was increased.

Reported by Todd Vernick.
This commit is contained in:
David Steele
2016-08-25 11:27:00 -04:00
parent 5ada189a92
commit c9bdf6a9ae
3 changed files with 35 additions and 4 deletions

View File

@@ -1832,10 +1832,18 @@ sub configLoad
if (optionTest(OPTION_DB_TIMEOUT) && optionTest(OPTION_PROTOCOL_TIMEOUT) &&
optionGet(OPTION_PROTOCOL_TIMEOUT) <= optionGet(OPTION_DB_TIMEOUT))
{
confess &log(ERROR,
"'" . optionGet(OPTION_PROTOCOL_TIMEOUT) . "' is not valid for '" . OPTION_PROTOCOL_TIMEOUT . "' option\n" .
"HINT: 'protocol-timeout' option should be greater than 'db-timeout' option.",
ERROR_OPTION_INVALID_VALUE);
# If protocol-timeout is default then increase it to be greater than db-timeout
if (optionSource(OPTION_PROTOCOL_TIMEOUT) eq SOURCE_DEFAULT)
{
optionSet(OPTION_PROTOCOL_TIMEOUT, optionGet(OPTION_DB_TIMEOUT) + 30);
}
else
{
confess &log(ERROR,
"'" . optionGet(OPTION_PROTOCOL_TIMEOUT) . "' is not valid for '" . OPTION_PROTOCOL_TIMEOUT . "' option\n" .
"HINT: 'protocol-timeout' option should be greater than 'db-timeout' option.",
ERROR_OPTION_INVALID_VALUE);
}
}
# Make sure that backup and db are not both remote