Skip to content

Commit d30054c

Browse files
trondndaverigby
authored andcommitted
Reset send queue size before returning to libevent
We currently check if a connection is stuck transmitting data to the client before starting to execute commands and record the current transmit queue and the current time. If the connection _isn't_ stuck, but have data in its output buffer we might add more data to the output buffer and the kernel may accept exactly this amount of data leaving the queue size the same causing us to think the connection is stuck and shut down the connection. This patch checks (and possibly adjust the send queue size and timer) after processing all cookies. Change-Id: I2e0d872ee8f5ceb837dc66fec0e7bbd88b475d4a Reviewed-on: http://review.couchbase.org/c/kv_engine/+/139643 Reviewed-by: Jim Walker <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent bd0ffa4 commit d30054c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

daemon/connection.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,12 @@ bool Connection::executeCommandsCallback() {
702702
scheduler_info[getThread().index].add(duration_cast<microseconds>(ns));
703703
addCpuTime(ns);
704704

705+
if (state == State::running) {
706+
// We might have added data to the send queue; make sure that
707+
// we update the counters
708+
shutdownIfSendQueueStuck(start);
709+
}
710+
705711
if (state != State::running) {
706712
if (state == State::closing) {
707713
externalAuthManager->remove(*this);

0 commit comments

Comments
 (0)