You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MB-26979: ChkptProcessorTask should not own dcp stream objs
Currently the ActiveStreamCheckpointProcessorTask co-owns the
corresponding stream object. So if the producer connection
(co-owner) quickly closes the stream and opens a new stream on the same
vbucket (that is the streams map of the producer will contain
new stream object), then the ActiveStreamCheckpointProcessorTask
will contain any entry to the older stream. This could result in a
case where the processor task is not run for the new stream which
could result in a DCP hang.
This commit fixes the issue by making sure that the processor
task only contains the vbucket id and the stream is looked up from
the producer streams map when needed. However this requires the
ActiveStreamCheckpointProcessorTask to hold a shared reference to
the producer though the producer obj holds a shared reference to
the task (thereby resulting in a cyclic reference). Hence in the delete
path, the cyclic reference is broken by manually deleting the producer
reference.
The problem of cyclic reference can be averted in the master branch
by the use of shared/weak ptr.
Also, to test the code, some refactoring of test code is done.
Change-Id: I4b16bb81aac6f45a137affa9870be6f1416e9464
Reviewed-on: http://review.couchbase.org/86277
Well-Formed: Build Bot <[email protected]>
Tested-by: Build Bot <[email protected]>
Reviewed-by: Jim Walker <[email protected]>
0 commit comments