Skip to content

Commit

Permalink
Ignore sendq size for input packets for DCP connections
Browse files Browse the repository at this point in the history
This allows DCP connections to process response packets even
if their send queue is full

Change-Id: I432978046e558bb3be6b5eb8d1a5963ee1670c4d
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/148145
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Paolo Cocchi <paolo.cocchi@couchbase.com>
  • Loading branch information
trondn committed Mar 15, 2021
1 parent af2d9b9 commit 4e25af7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions daemon/connection.cc
Expand Up @@ -532,7 +532,7 @@ void Connection::executeCommandPipeline() {
// Only look at new commands if we don't have any active commands
// or the active command allows for reordering.
auto input = bufferevent_get_input(bev.get());
bool stop = (getSendQueueSize() >= maxSendQueueSize);
bool stop = isDCP() ? false : (getSendQueueSize() >= maxSendQueueSize);
while (!stop && cookies.size() < maxActiveCommands &&
isPacketAvailable() && numEvents > 0) {
if (!cookies.back()->empty()) {
Expand All @@ -556,7 +556,8 @@ void Connection::executeCommandPipeline() {
cookie.reset();
// Check that we're not reserving too much memory for
// this client...
stop = (getSendQueueSize() >= maxSendQueueSize);
stop = isDCP() ? false
: (getSendQueueSize() >= maxSendQueueSize);
} else {
active = true;
// We need to block so we need to preserve the request
Expand Down Expand Up @@ -600,7 +601,7 @@ void Connection::executeCommandPipeline() {
// the thread to be run again if we've got a pending notification for
// the thread (an active command running which is waiting for the engine)
// If the last command in the pipeline may be reordered we can add more
if ((getSendQueueSize() < maxSendQueueSize) &&
if ((isDCP() || (getSendQueueSize() < maxSendQueueSize)) &&
(!active || (cookies.back()->mayReorder() &&
cookies.size() < maxActiveCommands))) {
enableReadEvent();
Expand Down

0 comments on commit 4e25af7

Please sign in to comment.