[pve-devel] [PATCH] reset timeout to 1 hour if process is a worker process
Wolfgang Link
w.link at proxmox.com
Tue Jan 26 16:59:39 CET 2016
We can raise the timeout because it does not matter if a worker process need longer.
---
src/PVE/Tools.pm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 9f08aa6..c9343e5 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -21,6 +21,7 @@ use Digest::SHA;
use Text::ParseWords;
use String::ShellQuote;
use Time::HiRes qw(usleep gettimeofday tv_interval alarm);
+use PVE::RPCEnvironment;
# avoid warning when parsing long hex values with hex()
no warnings 'portable'; # Support for 64-bit ints required
@@ -376,10 +377,13 @@ sub run_command {
my $error = IO::File->new();
# try to avoid locale related issues/warnings
- my $lang = $param{lang} || 'C';
-
+ my $lang = $param{lang} || 'C';
+
my $orig_pid = $$;
+ #set always if an extra worker is forked the timout to 1 hour
+ $timeout = 60*60 if PVE::RPCEnvironment::is_worker($orig_pid);
+
eval {
local $ENV{LC_ALL} = $lang;
--
2.1.4
More information about the pve-devel
mailing list