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

Force plain (not gzipped) aws response on aiohttp request #57

Merged
merged 2 commits into from
Oct 15, 2016

Conversation

rymir
Copy link
Contributor

@rymir rymir commented Aug 11, 2016

When using aiobotocore with dynamodb, requests fail on crc32 checksum computation as soon as the response data reaches ~5KB.

It seems that this is due to aws sending data back in gzip compressed format, aiohttp automatically uncompressing it and crc32 checksum being computed on the uncompressed data bytes.
While crc32 has to be computed on compressed data in order to pass.

The same requests work as expected when using botocore, this commit forces aws not to use gzip compression.

I created this fix to show the problem and to temporarily patch the issue, but the right way would be configuring aiohttp not to uncompress the response and leave that up to botocore, so we can take advantage of the gzip compression when data >= ~5KB.

@jettify
Copy link
Member

jettify commented Aug 12, 2016

Thanks for report, I will take a look once I got home, next week.

On Thu, 11 Aug 2016 at 05:13 Alexej Tessaro notifications@github.com
wrote:

When using aiobotocore with dynamodb, requests fail on crc32 checksum
computation as soon as the response data reaches ~5KB.

It seems that this is due to aws sending data back in gzip compressed
format, aiohttp automatically uncompressing it and crc32 checksum being
computed on the uncompressed data bytes.
While crc32 has to be computed on compressed data in order to pass.

The same requests work as expected when using botocore, this commit forces
aws not to use gzip compression.

I created this fix to show the problem and to temporarily patch the issue,
but the right way would be configuring aiohttp not to uncompress the
response and leave that up to botocore, so we can take advantage of the

gzip compression when data >= ~5KB.

You can view, comment on, or merge this pull request online at:

#57
Commit Summary

  • Force plain (not gzipped) aws response on aiohttp request

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#57, or mute the thread
https://github.com/notifications/unsubscribe-auth/AANoZ-zcwB6L2dbdNUo8wNuW38Awqndqks5qeue5gaJpZM4Jh7iN
.

@rymir
Copy link
Contributor Author

rymir commented Oct 10, 2016

@jettify any update on this one?

@jettify
Copy link
Member

jettify commented Oct 10, 2016

sorry for delay I will execute my test suite for s3 today, to make sure everything is ok. Also I need help with testing, could you port at least one test from botocore that hits dynamo?

@rymir
Copy link
Contributor Author

rymir commented Oct 10, 2016

I'm struggling finding the tests we could port, which one of https://github.com/boto/botocore/tree/master/tests you think we should port?

@jettify
Copy link
Member

jettify commented Oct 10, 2016

oh I see, they do not have any. Then very simple test create/delete dummy table will work fine.

@rymir
Copy link
Contributor Author

rymir commented Oct 10, 2016

@jettify ok, good chance to learn some pytest!

@jettify
Copy link
Member

jettify commented Oct 10, 2016

@rymir I executed s3 test suite with your branch, tests are green. Lets also add comment why that header is important, just to avoid confusion later.

@rymir rymir force-pushed the force-plaintext-aws-response branch from 5a28914 to e449f6c Compare October 14, 2016 11:16
When using aiobotocore with dynamodb, requests fail on crc32
checksum computation as soon as the response data reaches ~5KB.

It seems that this is  due to aws sending data back in gzip
compressed format, aiohttp automatically uncompressing it
and crc32 checksum being computed on the uncompressed data bytes.
While crc32 has to be computed on compressed data in order
to pass.

The same requests work as expected when using botocore, this
commit forces aws not to use gzip compression.
@rymir rymir force-pushed the force-plaintext-aws-response branch from e449f6c to 0dae162 Compare October 14, 2016 11:22
@rymir
Copy link
Contributor Author

rymir commented Oct 14, 2016

@jettify added a test and a comment

@jettify
Copy link
Member

jettify commented Oct 15, 2016

thanks!

@jettify jettify merged commit 8c1c81b into aio-libs:master Oct 15, 2016
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.

2 participants