-
Notifications
You must be signed in to change notification settings - Fork 539
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
(Work in progress) Support binary protocol #207
base: main
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
nice. gave it a quick skim and it's certainly a start. Hopefully there's a way to validate the magic value properly (ie; client request or response code paths)? |
e285864
to
e533e58
Compare
@dormando took me some time to understand your last question 😅 The The binary response code isn't ready yet, it'll involve adding some more serialization code in a subsequent commit. |
@andreazevedo @dormando one issue I've encountered is that, by right, the binary protocol is supposed to handle variations of commands such as quiet response and return key on response. So a few ways I've thought up is:
My interest is to get mcrouter to work with the Ruby library dalli, and it seems like dalli doesn't really care if we return redundant data. Other libraries may not guarantee such things however. I'd appreciate any advice on this subject. Meanwhile I'll just go ahead and stick to ignoring the additional flags. |
@@ -120,6 +121,7 @@ class WriteBuffer { | |||
/* Write buffers */ | |||
union { | |||
AsciiSerializedReply asciiReply_; | |||
BinarySerializedReply binaryeply_; |
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.
think you meant BinarySerializedReply binaryReply_;
?
@Ngo-The-Trung are you still interested in working on this? How can I help? |
I'll find some time to work on this (a bit busy this weekend). Also will have to rebase this since it's been months since I last touch it. But yes, I do plan on completing this. |
@Ngo-The-Trung any updates on this. Any help desired? |
@craig-day I admit I have kind of forgotten about this; taking some time this week to work on this |
0x80 for request 0x81 for response
Likely better to add new Reply classes to handle this
fd7a002
to
113ac12
Compare
@Ngo-The-Trung were you able to work on this? :D |
👋 I was able to pick this up a little bit before during the holidays, but I'm afraid I'm lacking time to work on this if anyone wants to pick it up. https://github.com/facebook/mcrouter/compare/master...maximebedard:binary-protocol?expand=1 My branch is still very dirty, but I fixed a few bugs and started implementing a python client to be able to swap between ascii/binary in the integration tests. Such client would allow to compare if there's actually feature parity between both protocols. What is still missing is parsing the binary replies from the upstreams, which is very time consuming 😒 |
An attempt at fixing #6
Foreword: I'm not good at C++ at all. All advices welcomed, especially advices on the approach - I'm not sure if this is the right way to do it at all (for instance, is using reinterpret_cast a proper way to parse network data?).
TODO: