Skip to content

Conversation

@avsej
Copy link
Member

@avsej avsej commented Dec 18, 2023

No description provided.

@avsej avsej requested review from a team and thejcfactor 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 couchbase:main Dec 19, 2023
@avsej avsej deleted the CXXCBC-419-reset-protocol-parser-before-bootstrap branch December 19, 2023 00:21
@brett19
Copy link
Member

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

Development

Successfully merging this pull request may close these issues.

3 participants