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

provider/aws: Fix hashing of EBS volumes in spot fleet requests to prevent panics #9857

Merged
merged 2 commits into from
Nov 4, 2016

Conversation

paddycarver
Copy link
Contributor

Spot fleet requests were mistakenly trying to hash EBS volumes using ephemeral volume attributes. This led to crashes and weird EOF errors, as seen in #8822 when the value ended up being nil when it wasn't expected to be.

To fix this, I switched to using the hashEbsBlockDevice function used in the Schema, but that also assumed that optional attributes would be present. To fix the crashes it had, I checked for existence of those attributes before trying to use them.

The majority of the PR is an acceptance test that exposed the issue, which now passes.

Fixes #8822

Spot fleet requests can have EBS volumes attached to them, and at
the moment we're getting reports that crashes can be experienced
with them. This adds an acceptance test that exercises creating
a Spot Fleet request that has a non-instance EBS volume attached.
This successfully reproduces the panic.
When computing the set key for an EBS block device, we were using
the wrong function; we had hashEphemeralBlockDevice instead of
hashEbsBlockDevice. This caused a panic by trying to access the
virtual_name attribute that will never be set for EBS block
devices.

To fix this, I switched to the hashEbsBlockDevice function, which
is already being used to compute a Set key in the Schema. But in
the default case, where the snapshot_id attribute isn't specified,
this also caused a panic. I updated the way the string to hash is
generated to check for the existence of the device_name and
snapshot_id attributes before we use them, to avoid panics when
these optional attributes aren't set.
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

LGTM!

@paddycarver paddycarver merged commit a15726d into master Nov 4, 2016
@stack72 stack72 deleted the paddy_8822_fix_spot_fleet_ebs branch December 12, 2016 15:01
@ghost
Copy link

ghost commented Apr 18, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_spot_fleet_request: unexpected EOF (panic: interface conversion: interface is nil, not string)
2 participants