MB-19886: Fix data race on ActiveStream::curChkSeqno by making it atomic 62/64862/4
authorManu Dhundi <manu@couchbase.com>
Fri, 10 Jun 2016 01:07:25 +0000 (18:07 -0700)
committerDave Rigby <daver@couchbase.com>
Mon, 13 Jun 2016 16:03:17 +0000 (16:03 +0000)
commit9b194271f12e9b620c803a11b77a62e5402fb346
tree68fa03eaf23b5b04c9591d3adb785658dac993a6
parent99156468444de5c5a2bc319b1a70d5b4729c0d0a
MB-19886: Fix data race on ActiveStream::curChkSeqno by making it atomic

Fix the data race
http://cv.jenkins.couchbase.com/job/ep-engine-threadsanitizer-3.0.x/266/consoleFull

WARNING: ThreadSanitizer: data race (pid=109115)
   Write of size 8 at 0x7d480000b088 by thread T16:
     #0 ActiveStream::processItems(std::deque<SingleThreadedRCPtr<Item>, std::allocator<SingleThreadedRCPtr<Item> > >&) /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-3.0.x/ep-engine/src/dcp-stream.cc:760 (ep.so+0x000000297e65)
     #1 ActiveStream::nextCheckpointItemTask() /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-3.0.x/ep-engine/src/dcp-stream.cc:724 (ep.so+0x0000002976ab)
     #2 ActiveStreamCheckpointProcessorTask::run() /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-3.0.x/ep-engine/src/dcp-stream.cc:679 (ep.so+0x0000002973ad)
     #3 ExecutorThread::run() /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-3.0.x/ep-engine/src/executorthread.cc:109 (ep.so+0x0000001e3fe1)
     #4 launch_executor_thread(void*) /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-3.0.x/ep-engine/src/executorthread.cc:34 (ep.so+0x0000001e360a)
     #5 platform_thread_wrap /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-3.0.x/platform/src/cb_pthreads.c (libplatform.so.0.1.0+0x00000000377c)

   Previous read of size 8 at 0x7d480000b088 by main thread:
     [failed to restore the stack]

SUMMARY: ThreadSanitizer: data race /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-3.0.x/ep-engine/src/dcp-stream.cc:760 ActiveStream::processItems(std::deque<SingleThreadedRCPtr<Item>, std::allocator<SingleThreadedRCPtr<Item> > >&)
Change-Id: I7fa5dd9110342ca836b6b0b0f203dd8b063cf20d
Reviewed-on: http://review.couchbase.org/64862
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
src/dcp-stream.h