Details
-
Bug
-
Resolution: Fixed
-
Major
-
4.0.0, 4.1.0
-
Security Level: Public
-
None
-
Untriaged
-
Yes
Description
From Jim Walker:
The DcpProducer cannot be deleted because its deletion is performed via a smart pointer, but the DcpProducer in 4.0 is effectively
holding a reference to itself.
http://src.couchbase.org/source/xref/sherlock/ep-engine/src/dcp-producer.cc#80
That line of code passes “this" to BackfillManager and stored inside the manager as a smart pointer. By line 81 the DcpProducer has a reference of 1
and thus can never be deleted via the smart pointer cleanup we rely upon.
The leak though we are exposed to means that a DCP connection that is terminated will leak a DcpProducer object which I’ve calculated to be
less than 400 bytes.
This leak will be for every terminated DCP producer, be clean terminate or a connection-reset.