-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
rewrite buffer implementation to eliminate evbuffer dependency #5441
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
8d8090f
rewrite buffer implementation to eliminate evbuffer dependency
brian-pane b038d9b
fix clang-tidy warnings
brian-pane 41b9397
fix additional clang-tidy warnings
brian-pane 7845cb6
cleanups based on code review feedback
brian-pane 14722be
cleanups based on code review feedback
brian-pane 7840114
clean up the BufferSlice interface
brian-pane bfca4f9
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane 7094216
formatting fixes and additional comments
brian-pane fa94625
enable reserve() to use multiple slices
brian-pane b38b8da
redesign the slice implementation for better performance
brian-pane 33fdb6f
add a faster deque implementation
brian-pane 059c366
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane 0af83c1
speed up prepend operations and small reserve/commit operations
brian-pane 5b3f606
add unit tests for Slice and SliceDeque
brian-pane 4f95325
fix comment typos
brian-pane d4c0340
fix use-after-free error in one of the test cases
brian-pane 14a6513
fix some clang-tidy warnings
brian-pane 068a917
cleanups based on code review feedback, plus more memory-efficient Ow…
brian-pane d2c27bf
fix an asan error in one of the tests
brian-pane 7d71d0f
support runtime selection of the old or new buffer implementation
brian-pane feeb6cb
add a command-line flag to enable evbuffer
brian-pane 6705c9a
add a missing initializer
brian-pane 8e5a98d
update tests based on code review feedback, add tests for search meth…
brian-pane 06881ba
cleanups based on code review comments
brian-pane 736f04c
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane 125f7b2
switch to new test base class
brian-pane 7640301
fix C++14 non-placement operator delete warning
brian-pane 3bb6e6d
formatting fix
brian-pane c63e68e
update spelling dictionary, add tests for buffersEqual test utility f…
brian-pane f0a415d
add asserts to validate subclass casts
brian-pane 6a32042
eliminate the need for const_cast inside the buffer impl
brian-pane e90174c
cleanups based on code review feedback
brian-pane 81a68e1
use the old buffer implementation by default
brian-pane 56d4988
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane 6170ae6
release notes to explain how to enable new buffer impl
brian-pane be5a550
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane 323c39d
restore a new assert lost in the previous merge
brian-pane e506fd3
fixes related to fuzz tests:
brian-pane 9780a5d
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane cfd9d4a
allow both old and new buffer impls to be used in the same process (t…
brian-pane 3bcd656
formatting fix
brian-pane d405218
revert changes to metadata_encoder
brian-pane cf37183
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane c40a58a
changes based on code review feedback:
brian-pane 0d3e1c4
Merge remote-tracking branch 'upstream/master' into buffer
brian-pane 267d269
add runtime overflow checking for buffer length
brian-pane a9ff465
switch to a compiler-independent detection of buffer length overflow/…
brian-pane 4d552f2
workaround for the coverage build
brian-pane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
This may have been addressed earlier in review but I'm going to be lazy here and ask you to catch me up. :-)
Do we have a plan for roll out? Are we submitting this, flipping it and seeing if it sticks? I wish we had a better plan for testing high risk changes than asking Lyft to smoke test, but that has often been what we do with and AFIK they prefer runtime over command line flags (which was part of the impetus behind #6134)
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.
@rgs1 would you be interested in testing this with production traffic in your environment? It requires a command-line flag to turn it on.
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.
I think the plan here should be:
WDYT?
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.
Having finally at least skimmed through this whole PR, I'm not sure using a reloadable flag is appropriate. Many of the functions only work when comparing old buffer to old buffer and new to new, so I think we'd either have to do some plumbing to make sure the state was consistent throughout all buffers on a given connection (which might not even work then given muxed client connections can share a different muxed upstream connection) or we'd have to implement restart flags as well.
Rather one can latch the value of the runtime once where it's currently set, but then it's not actually doing new-style buffers until after a restart. internally we make clear the differences between reloadable and restart flags so you know the difference between when you push things and when they take effect. Alternately we could use the new config guard code it'd just be fairly misleading and we'd want to communicate it doesn't work as advertised in this case.
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.
This PR used to latch the value just once per process, except for a test override method. But the problem with that was that it broke the coverage test, which expected to be able to concatenate together a lot of tests that originally were designed to be separate programs with their own control over the choice of buffer implementation.