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

Sleep is not called in attachVolume, causing the function to check for status very frequently in short time #5

Open
vroad opened this issue Aug 19, 2019 · 0 comments

Comments

@vroad
Copy link

vroad commented Aug 19, 2019

According to README of jpillora/backoff you should call time.Sleep manually to wait for calculated duration. b.Duration just calculates the time you need to wait.
But time.Sleep is never called.

etcd3-bootstrap/ebs.go

Lines 81 to 102 in 80311f3

volumeDescs, err := svc.DescribeVolumes(&ec2.DescribeVolumesInput{
VolumeIds: []*string{volume.VolumeId},
})
if err != nil {
return errors.Wrap(err, "Error retrieving volume description status")
}
volumes := volumeDescs.Volumes
if len(volumes) == 0 {
continue
}
if len(volumes[0].Attachments) == 0 {
continue
}
if *volumes[0].Attachments[0].State == ec2.VolumeAttachmentStateAttached {
break
}
log.Printf("Waiting for attachment to complete. Current state: %s", *volumes[0].Attachments[0].State)
b.Duration()

https://github.com/jpillora/backoff/blob/1.0.0/README.md#example-using-net-package

And even after fixing this, the problem still occurs with filesystem formatting.
If you try to format filesystem right after the status become attached, it fails because /dev/xvdf is not yet ready.
You should need to give enough amount of time for the device to be ready.

the file /dev/xvdf does not exist and no size was specified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant