Skip to content

Commit 5c49ec2

Browse files
committed
MB-59710: DCP connections must wait for blocked cookies
DCP connections didn't correctly use the 'ewouldblock' state variable in the initial refactors from the old state machine over to using bufferevents. Over the time we've cleaned up the usage of the variable and introduced an assertion as part of shutting down the cookie that it is no longer in a blocked state. We've had a lurking bomb in our code for a while as we would be using dangling pointers for DCP connections during shutdown if the core was executing an incomming command at the same time as we where trying shut down the connection. This patch waits for all blocked cookies to complete before continuing the shutdown (DCP connections use the reference count and scheduleDcpStep and not the blocked state of the cookie) Change-Id: I27c401c67a7b1d54d542f39df768842ddfdac831 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/201211 Tested-by: Trond Norbye <[email protected]> Reviewed-by: Paolo Cocchi <[email protected]> Well-Formed: Restriction Checker
1 parent ca0dcff commit 5c49ec2

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

daemon/connection.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,12 +1583,6 @@ void Connection::close() {
15831583
// disconnected
15841584
propagateDisconnect();
15851585

1586-
if (isDCP()) {
1587-
// DCP channels work a bit different.. they use the refcount
1588-
// to track if it has a reference in the engine
1589-
ewb = false;
1590-
}
1591-
15921586
if (rc > 1 || ewb || havePendingData()) {
15931587
state = State::pending_close;
15941588
} else {

0 commit comments

Comments
 (0)