MB-21475: Account for memory alloc/dealloc in stopTaskGroup 84/69184/2
authorDave Rigby <daver@couchbase.com>
Tue, 25 Oct 2016 12:23:13 +0000 (13:23 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 27 Oct 2016 10:42:26 +0000 (10:42 +0000)
While stopping a task group, any memory allocations/deallocations made
should be accounted to the bucket in question.  Hence no
`onSwitchThread(NULL)` call.

(Note: This is very similar to MB-20054).

Change-Id: Ib5f88fe8e4061ac827a28e267717df32131aba23
Reviewed-on: http://review.couchbase.org/69184
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Daniel Owen <owend@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
src/executorpool.cc

index b889079..5b9a32c 100644 (file)
@@ -579,10 +579,10 @@ bool ExecutorPool::_stopTaskGroup(task_gid_t taskGID,
 bool ExecutorPool::stopTaskGroup(task_gid_t taskGID,
                                  task_type_t taskType,
                                  bool force) {
-    EventuallyPersistentEngine *epe = ObjectRegistry::onSwitchThread(NULL, true);
-    bool rv = _stopTaskGroup(taskGID, taskType, force);
-    ObjectRegistry::onSwitchThread(epe);
-    return rv;
+    // Note: Stopping a task group is special - any memory allocations /
+    // deallocations made while unregistering *should* be accounted to the
+    // bucket in question - hence no `onSwitchThread(NULL)` call.
+    return _stopTaskGroup(taskGID, taskType, force);
 }
 
 void ExecutorPool::_unregisterTaskable(Taskable& taskable, bool force) {