Skip to content

Conversation

@BorysTheDev
Copy link
Contributor

related to #6009

Added coordinator connection reusing

@BorysTheDev BorysTheDev requested a review from dranikpg December 8, 2025 12:37
Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Comment augment review to trigger a new review at any time.

@BorysTheDev BorysTheDev force-pushed the add_coordinator_connection_reusing branch from a897b5e to e778a76 Compare December 8, 2025 12:43
Comment on lines 12 to 13
class TakeRespExpr {
public:
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Take is a verb, its better to be Taken or Owned
  2. Is it temporary? Why a new class? Why in /server?

RespExpr isn't much used besides the connection code (and tests), maybe you can modify the original one to have an owned buffer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added it here because of protocol client

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for further developement we need better command parsing approach and I think it will be more code, maybe I will create a separate directory and move this code there.

return res;
}

io::Result<TakeRespExpr::Vec> ProtocolClient::TakeRespReply(base::IoBuf* buffer, bool copy_msg) {
Copy link
Contributor

Choose a reason for hiding this comment

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

its the same as ReadRespExpr except some small details. If this code is not temporary, please keep it as one function. Futhermore, if you extend RespExpr to be owning, you can pass it just as a parameter without any templates

@BorysTheDev BorysTheDev force-pushed the add_coordinator_connection_reusing branch from e778a76 to d74ef3a Compare December 9, 2025 13:15
@BorysTheDev BorysTheDev requested a review from dranikpg December 9, 2025 13:16
@BorysTheDev BorysTheDev force-pushed the add_coordinator_connection_reusing branch from d74ef3a to b3f6299 Compare December 9, 2025 13:49
Copy link
Contributor

@dranikpg dranikpg left a comment

Choose a reason for hiding this comment

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

I'm not going to force my opinion on you any further but it seems like the separate type is redundant

using Vec = std::vector<OwnedRespExpr>;
Type type;

std::variant<int64_t, double, Buffer, Vec> u;
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't understand why you can't extedn RespExpr with an OwnedBuffer type and then adapt TakeRespReply to conditionally use either of those

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do in one of the next PRs

@BorysTheDev BorysTheDev merged commit c0af6b8 into main Dec 10, 2025
10 checks passed
@BorysTheDev BorysTheDev deleted the add_coordinator_connection_reusing branch December 10, 2025 11:02
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