Skip to content

Fix/ebs device resolve retry#4002

Merged
r4victor merged 2 commits into
dstackai:masterfrom
james-boydell:fix/ebs-device-resolve-retry
Jul 6, 2026
Merged

Fix/ebs device resolve retry#4002
r4victor merged 2 commits into
dstackai:masterfrom
james-boydell:fix/ebs-device-resolve-retry

Conversation

@james-boydell

@james-boydell james-boydell commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #4001
GetRealDeviceName ran lsblk once and hard-failed with "volume not found among block devices" if the device wasn't there yet. But AttachVolume returning success doesn't mean the guest kernel has enumerated the NVMe device, so resolving right after attach intermittently failed. This polls for the device (30s timeout, 500ms interval) instead of failing on the first miss. Threads ctx through the backend interface so retries log to shim.log.

@james-boydell james-boydell marked this pull request as ready for review July 3, 2026 18:37
@peterschmidt85 peterschmidt85 requested a review from r4victor July 3, 2026 18:41

@r4victor r4victor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it fixes #4002 on AWS. Theoretically, the same bug is possible on other backends so ideally the retry logic should be outside of GetRealDeviceName, not inside. But currently we support only GCP shim-attached volumes besides AWS, and it's not reproducible on GCP. Otherwise the PR is good so merging it as is for now.

@r4victor r4victor merged commit 973815e into dstackai:master Jul 6, 2026
24 checks passed
@r4victor

r4victor commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

@james-boydell, thanks for the PR

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

Successfully merging this pull request may close these issues.

[Bug]: shim occasionally fails to detect AWS EBS Volumes due to race condition

2 participants