fix: correctly handle buffered data from hijacked conns#76
Merged
Conversation
|
🔥 Run benchmarks comparing 62c196b against gh workflow run bench.yaml -f pr_number=76Note: this comment will update with each new commit. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #76 +/- ##
==========================================
+ Coverage 99.04% 99.07% +0.02%
==========================================
Files 2 2
Lines 421 431 +10
==========================================
+ Hits 417 427 +10
Misses 2 2
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
benchstats: 351f4c6...62c196bView full benchmark output on the workflow summary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think I've finally realized what's causing the flaky test failures described in #72. As noted in a follow-up comment
This smelled a bit like buffering somewhere, and it turns out that we were intentionally (and misguidedly) discarding the buffered reader/writer returned by Hijack when capturing the connection underlying an HTTP request:
And it turns out that the Hijack docs explicitly warn us that we may be discarding buffered reads (e.g., maybe the first byte written by a client):
So! Here we update our
Websocketto read through that buffer for all reads, while still writing directly to the underlyingnet.Conn. This should hopefully fix #72.(Plus, a few misc test updates.)