Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit c74c8ae

Browse files
committed
probeAttachedVolume improvement in Cinder
1 parent 6edc12e commit c74c8ae

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

pkg/volume/cinder/attacher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var _ volume.Attacher = &cinderDiskAttacher{}
4444
var _ volume.AttachableVolumePlugin = &cinderPlugin{}
4545

4646
const (
47-
checkSleepDuration = 1 * time.Second
47+
checkSleepDuration = 5 * time.Second
4848
operationFinishInitDealy = 1 * time.Second
4949
operationFinishFactor = 1.1
5050
operationFinishSteps = 10

pkg/volume/cinder/cinder_util.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,18 @@ func probeAttachedVolume() error {
224224
scsiHostRescan()
225225

226226
executor := exec.New()
227+
228+
// udevadm settle waits for udevd to process the device creation
229+
// events for all hardware devices, thus ensuring that any device
230+
// nodes have been created successfully before proceeding.
231+
argsSettle := []string{"settle", "--timeout=1"}
232+
cmdSettle := executor.Command("udevadm", argsSettle...)
233+
_, errSettle := cmdSettle.CombinedOutput()
234+
if errSettle != nil {
235+
glog.Errorf("error running udevadm settle %v\n", errSettle)
236+
return errSettle
237+
}
238+
227239
args := []string{"trigger"}
228240
cmd := executor.Command("udevadm", args...)
229241
_, err := cmd.CombinedOutput()

0 commit comments

Comments
 (0)