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

CXXCBC-419: ensure that MCBP protocol parser starts with clean state #496

Conversation

avsej
Copy link
Member

@avsej avsej commented Dec 18, 2023

No description provided.

@avsej avsej requested review from thejcfactor and a team December 18, 2023 23:35
Copy link
Contributor

@thejcfactor thejcfactor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@avsej avsej merged commit ca6969b into couchbaselabs:main Dec 19, 2023
12 of 14 checks passed
@avsej avsej deleted the CXXCBC-419-reset-protocol-parser-before-bootstrap branch December 19, 2023 00:21
@brett19
Copy link
Contributor

brett19 commented Dec 19, 2023

@avsej Can you explain where I've made an error in the following thinking for understanding why this reset call is neccessary? The mcbp_parser instance (_parser) is itself actually part of the mcbp_session object. That mcbp_session appears to be one-time use, and you are calling reset() in on_connect, which is inherently invoked only once, and always prior to the on_read's which ultimately feed data to the parser and pull packets off. Additionally, reset() doesn't appear to have any useful behaviour except clearing the buffer inside the parser, which would already be empty since it's a new object I would think.

@avsej
Copy link
Member Author

avsej commented Dec 19, 2023

no, it is not a one time object, and we reuse it if it cannot bootstrap, we just reopen the underlying TCP socket. Yes it is rather a design flaw, and this bug proves the weakness of reusing the session during retrying bootstrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants