-
Notifications
You must be signed in to change notification settings - Fork 813
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
Add explicit AttachVolume
call in WaitForAttachmentState
#2005
Add explicit AttachVolume
call in WaitForAttachmentState
#2005
Conversation
Code Coverage DiffThis PR does not change the code coverage |
Signed-off-by: torredil <[email protected]>
b6cb4f8
to
f3cc303
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ConnorJC3 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @torredil. We're experiencing frequent attachment failures with the log "expected device to be attached but was detached". By looking on EC2, it looks like the volume is bound to the node, but the volume's state is still "Available", and the attachment status doesn't say "Attached". It looks like your change here would fix this as you're triggering a new |
Hey @stefanc18 An error is intentionally returned here to short-circuit the
Once |
Is this a bug fix or adding new feature?
Bug Fix
What is this PR about? / Why do we need it?
Today, the driver relies on the
DescribeInstances
API to determine the attachment state of a volume to an EC2 instance. The API may incorrectly report the volume as attached due to EC2's eventual consistency model, as a result the driver will skip making an expectedAttachVolume
API call and proceed to directly poll the attachment state of the volume.This PR adds an explicit
AttachVolume
API call in theWaitForAttachmentState
function when there is a mismatch between the expected attachment state and the actual attachment state reported for a volume. If theAttachVolume
call fails, it is logged for debugging purposes but the overall behavior of returning an error and triggering a retry of theAttachDisk
operation remains unchanged.What testing is done?
make test && make verify