Commit 312fcd27 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(backend): deal with gone volumes

issue #1140
parent c0d3c9f2
......@@ -458,7 +458,11 @@ sub file_exists($self, $file) {
$self->_wait_storage( sub { $pool->refresh() } );
my @volumes = $self->_wait_storage( sub { $pool->list_all_volumes });
for my $vol ( @volumes ) {
return 1 if $vol->get_path eq $file;
my $found;
eval { $found = 1 if $vol->get_path eq $file };
# volume was removed in the nick of time
die $@ if $@ && ( !ref($@) || $@->code != 50);
return 1 if $found;
}
}
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment