[pve-devel] [PATCH ha-manager 06/13] Use timeout for shutdown in LRM

Fabian Ebner f.ebner at proxmox.com
Thu Sep 26 13:38:52 CEST 2019


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/PVE/HA/LRM.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm
index 3b4a572..7002ddd 100644
--- a/src/PVE/HA/LRM.pm
+++ b/src/PVE/HA/LRM.pm
@@ -535,7 +535,7 @@ sub manage_resources {
 	my $req_state = $sd->{state};
 	next if !defined($req_state);
 	next if $req_state eq 'freeze';
-	$self->queue_resource_command($sid, $sd->{uid}, $req_state, {'target' => $sd->{target}});
+	$self->queue_resource_command($sid, $sd->{uid}, $req_state, {'target' => $sd->{target}, 'timeout' => $sd->{timeout}});
     }
 
     return $self->run_workers();
@@ -774,9 +774,11 @@ sub exec_resource_agent {
 
 	return SUCCESS if !$running;
 
+	my $timeout = $params->{timeout} // 60;
+
 	$haenv->log("info", "stopping service $sid");
 
-	$plugin->shutdown($haenv, $id);
+	$plugin->shutdown($haenv, $id, $timeout);
 
 	$running = $plugin->check_running($haenv, $id);
 
-- 
2.20.1





More information about the pve-devel mailing list