Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase device discovery timeout to 30seconds/equal to checker_timeout #78475

Merged
merged 1 commit into from
Jun 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pkg/volume/iscsi/iscsi_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const (
// How many seconds to wait for a multipath device if at least two paths are available.
multipathDeviceTimeout = 10

// How many seconds to wait for a device/path to appear before giving up.
deviceDiscoveryTimeout = 30

// 'iscsiadm' error code stating that a session is logged in
// See https://github.com/open-iscsi/open-iscsi/blob/7d121d12ad6ba7783308c25ffd338a9fa0cc402b/include/iscsi_err.h#L37-L38
iscsiadmErrorSessExists = 15
Expand Down Expand Up @@ -417,10 +420,10 @@ func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) (string, error) {
devicePath = strings.Join([]string{"/dev/disk/by-path/pci", "*", "ip", tp, "iscsi", b.Iqn, "lun", b.Lun}, "-")
}

if exist := waitForPathToExist(&devicePath, multipathDeviceTimeout, iscsiTransport); !exist {
klog.Errorf("Could not attach disk: Timeout after %ds", multipathDeviceTimeout)
if exist := waitForPathToExist(&devicePath, deviceDiscoveryTimeout, iscsiTransport); !exist {
klog.Errorf("Could not attach disk: Timeout after %ds", deviceDiscoveryTimeout)
// update last error
lastErr = fmt.Errorf("Could not attach disk: Timeout after %ds", multipathDeviceTimeout)
lastErr = fmt.Errorf("Could not attach disk: Timeout after %ds", deviceDiscoveryTimeout)
continue
} else {
devicePaths[tp] = devicePath
Expand Down Expand Up @@ -456,8 +459,8 @@ func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) (string, error) {
}
// Try to find a multipath device for the volume
if len(bkpPortal) > 1 {
// Multipath volume was requested. Wait up to 10 seconds for the multipath device to appear.
devicePath = waitForMultiPathToExist(devicePathList, 10, b.deviceUtil)
// Multipath volume was requested. Wait up to multipathDeviceTimeout seconds for the multipath device to appear.
devicePath = waitForMultiPathToExist(devicePathList, multipathDeviceTimeout, b.deviceUtil)
} else {
// For PVs with 1 portal, just try one time to find the multipath device. This
// avoids a long pause when the multipath device will never get created, and
Expand Down