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

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Sep 26 14:59:56 CEST 2019


On 9/26/19 1:38 PM, Fabian Ebner wrote:
> 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;

I would not do the "// 60" here, so that the default value is only
in the resource plugins?

> +
>  	$haenv->log("info", "stopping service $sid");
>  
> -	$plugin->shutdown($haenv, $id);
> +	$plugin->shutdown($haenv, $id, $timeout);
>  
>  	$running = $plugin->check_running($haenv, $id);
>  
> 





More information about the pve-devel mailing list