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

Internal file handle revert #264

Merged
merged 3 commits into from
Nov 2, 2021
Merged

Conversation

ionrock
Copy link
Contributor

@ionrock ionrock commented Oct 31, 2021

We had a PR a while back that pre-emptively read the body and exhausted the internal file handle. This triggers a rare case where we need to read that file handle again apparently.

The hope is that fixes #263.

I believe there is a scenario where there is an ETAG and no body that
ends up updating the cache with an invalid empty body. This ensures
the internal file handle for requests is getting reset approriately.

Fixes 263
I'm adding the script here for reference. I don't think the URL or
scenario was especially unique, but it did exhibit the behavior and is
worth keeping around for reference.
@@ -25,10 +25,16 @@ def _b64_decode_str(s):


class Serializer(object):

def dumps(self, request, response, body):
def dumps(self, request, response, body=None):

Choose a reason for hiding this comment

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

Don't ned to revert this line, just explicitly pass None from update_cached_response?

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.

Cache hits cause empty response content
2 participants