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

fix(connection): Clear dispatch queue before pipeline squashing #2163

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Nov 12, 2023

Fixes a bug in #2156

Move block that is pipeline squashed out of the dispatch queue before applying it, see comment below

Comment on lines -1001 to -1005
// Dispatch queue could have grown, so handle strictly as many as we executed
for (size_t i = 0; i < args.size(); i++) {
recycle(move(dispatch_q_.front()));
dispatch_q_.pop_front();
}
Copy link
Contributor Author

@dranikpg dranikpg Nov 12, 2023

Choose a reason for hiding this comment

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

The bug here is that we don't account for commands that have been inserted upfront and we were deleting the wrong messages

@dranikpg dranikpg marked this pull request as ready for review November 13, 2023 08:05
@@ -239,6 +240,9 @@ class Connection : public util::Connection {

void SendAsync(MessageHandle msg);

// Updates memory stats and pooling, must be called for all used messages
void RecycleMessage(MessageHandle msg);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I never liked this name tbh, how about UsedMessageAccounting() or something like that?

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 doesn't sound like an action and somewhat confusing, I'd stick with the current

@dranikpg dranikpg merged commit 4b685aa into dragonflydb:main Nov 13, 2023
7 checks passed
@dranikpg dranikpg deleted the fix-pl-sq-consumption branch November 15, 2023 07:30
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.

None yet

2 participants