Skip to content

Comments

Internal file handle revert#264

Merged
ionrock merged 3 commits intomasterfrom
ionrock/internal-file-handle-revert
Nov 2, 2021
Merged

Internal file handle revert#264
ionrock merged 3 commits intomasterfrom
ionrock/internal-file-handle-revert

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.
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