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
switch default gateway server from hypercorn to twisted #10703
Conversation
S3 Image Test Results (AMD64 / ARM64) 2 files 2 suites 3m 0s ⏱️ Results for commit 3a53be3. ♻️ This comment has been updated with latest results. |
FYI: Changed the PR to draft and changed the milestone to |
Following up on our discussion @dfangl, I found that there are at least two checks in the stack trace whether the data buffer is empty or not:
The switch makes perfect sense to me. Why write anything when there's no data? While we could forego these conditions, I found no way to trigger a write buffer flush. I found this SO post on the topic, where one of the maintainers also suggest you shouldn't be talking to the reactor in this way in the first place. So in summary I would say this is not a problem with the server, but rather in the particular downstream implementation that relies on the assumption that a buffer will be flushed when you write empty bytes to it. My recommendation is therefore to fix the particular downstream implementation (for instance by sending a type of "stream initiated" event that can be ignored by clients) to make it more compatible with different IO frameworks. |
ea3e716
to
3a53be3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice to see everything addressed, thanks a lot for fixing it! 🚀
Can't wait to see all the nice performance increases showed in #9834!
Motivation
@thrau added twisted as supported gateway server with #9834. Since then this was tested by selected users, and it turned out to be a great server. In reduced complexity and improved performance.
Changes
GATEWAY_SERVER
fromhypercorn
totwisted
.Testing
TODO