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

Do not call blocking content property and lazily load response #2643

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

neiser
Copy link
Contributor

@neiser neiser commented Mar 18, 2024

This reverts commit 7ce89a0 and improves it for cases when stream=True and catch_response=True. Together with #2642, this finally makes handling long-running streaming requests possible and reporting a failure while consuming the response.

The problem is that calling response.content triggers a read of the whole response eventually, rendering subsequent (streaming) reads pointless.

@neiser neiser changed the title Do not call blocking content property and lazily load response Do not call blocking content property and lazily load response Mar 18, 2024
@neiser neiser force-pushed the fix-stream-support branch 4 times, most recently from ebe49a0 to a0c7694 Compare March 19, 2024 12:41
@neiser
Copy link
Contributor Author

neiser commented Mar 19, 2024

@cyberw I'm finally done with this PR. Please review!

@cyberw
Copy link
Collaborator

cyberw commented Mar 20, 2024

maybe set self._cached_content to None if there is an exception? And update the title of the PR?

@cyberw cyberw merged commit 87cfedf into locustio:master Mar 20, 2024
15 checks passed
@cyberw
Copy link
Collaborator

cyberw commented Mar 20, 2024

I went ahead and made a new release :) 2.24.1 should be out shortly. Also, all PR merges are pushed to pypi as prereleases (install the latest one by using pip install --pre -U locust)

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.

None yet

2 participants