[pve-devel] [PATCH] close tunnel after migration is finish.

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Feb 2 13:16:44 CET 2016


Ideally we'd find the root cause which I suspect somewhere in qemu's
handling of the open connection.

But the current code is apparently wrong in that the finish_tunnel() can
be skipped as the related phase3-cleanup portion is skipped if phase 2
errored.

Also avoiding the duplicated finish-block would mean putting either the
entire loop under an eval{} (big noisy patch) or putting the entire
rest of the phase2-cleanup code into an if() (another big noisy patch).

Since this fixes an actual bug people are running into it makes sense to
apply this until someone can investigate how the open ssh connections
manage to affect other independent ssh connections or migration
processes.

On Tue, Feb 02, 2016 at 11:53:17AM +0100, Wolfgang Link wrote:
> if we do not close it, there is a change that the tunnel stays open and the next migration will not work.

s/change/chance/

Acked-by: Wolfgang Bumiller <w.bumiller at proxmox.com>

> ---
>  PVE/QemuMigrate.pm | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 7ae3880..5da62eb 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -520,6 +520,14 @@ sub phase2 {
>  	    die "unable to parse migration status '$stat->{status}' - aborting\n";
>  	}
>      }
> +    #to be sure tat the tunnel is closed 
> +    if ($self->{tunnel}) {
> +	eval { finish_tunnel($self, $self->{tunnel});  };
> +	if (my $err = $@) {
> +	    $self->log('err', $err);
> +	    $self->{errors} = 1;
> +	}
> +    }
>  }
>  
>  sub phase2_cleanup {
> @@ -552,6 +560,14 @@ sub phase2_cleanup {
>          $self->log('err', $err);
>          $self->{errors} = 1;
>      }
> +
> +    if ($self->{tunnel}) {
> +	eval { finish_tunnel($self, $self->{tunnel});  };
> +	if (my $err = $@) {
> +	    $self->log('err', $err);
> +	    $self->{errors} = 1;
> +	}
> +    }
>  }
>  
>  sub phase3 {
> @@ -621,14 +637,6 @@ sub phase3_cleanup {
>  	$self->{errors} = 1;
>      }
>  
> -    if ($self->{tunnel}) {
> -	eval { finish_tunnel($self, $self->{tunnel});  };
> -	if (my $err = $@) {
> -	    $self->log('err', $err);
> -	    $self->{errors} = 1;
> -	}
> -    }
> -
>      # always deactivate volumes - avoid lvm LVs to be active on several nodes
>      eval {
>  	my $vollist = PVE::QemuServer::get_vm_volumes($conf);
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list