From 5423702adee9125e518375ea5aa7bd749ae87565 Mon Sep 17 00:00:00 2001 From: timansky Date: Wed, 26 Mar 2025 14:33:57 +0500 Subject: [PATCH] Increase timeout; Added additional check (#61) --- PureStoragePlugin.pm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/PureStoragePlugin.pm b/PureStoragePlugin.pm index 8baabd8..51c2518 100644 --- a/PureStoragePlugin.pm +++ b/PureStoragePlugin.pm @@ -1053,13 +1053,24 @@ sub map_volume { }; # Wait for the device to appear - wait_for( $path_exists, "volume \"$volname\" to map" ); + if ( wait_for( $path_exists, "volume \"$volname\" to map" ) ) { - # we might end up with operational disk but without multipathing, e.g. - # if unmapping was interrupted ('remove map' was already done, but slaves were not removed) - exec_command( [ 'multipathd', 'add', 'map', $wwid ] ) unless multipath_check( $wwid ); + # we might end up with operational disk but without multipathing, e.g. + # if unmapping was interrupted ('remove map' was already done, but slaves were not removed) + if ( !multipath_check( $wwid ) ) { + print "Debug :: Adding multipath map for device \"$wwid\"\n" if $DEBUG; + exec_command( [ 'multipathd', 'add', 'map', $wwid ] ); - return $path; + # Wait for multipath to be fully established + my $multipath_ready = sub { + return multipath_check( $wwid ); + }; + wait_for( $multipath_ready, "multipath map for volume \"$volname\" to be ready", 30, 0.5 ); + } + return $path; + } + + die "Error :: Local path \"$path\" does not exist.\n"; } sub unmap_volume {