Skip to content

Commit bd425f9

Browse files
jimwwalkerdaverigby
authored andcommitted
MB-33900: Correct allocator context for ExecutorPool::shutdown
Use the NonBucketAllocationGuard in ExecutorPool::shutdown to match the allocation in ::get() Change-Id: Ica550695d43c5c3b5d11f7b78c81404985ca967b Reviewed-on: http://review.couchbase.org/108145 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent daefab4 commit bd425f9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

engines/ep/src/executorpool.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,13 @@ ExecutorPool *ExecutorPool::get(void) {
130130

131131
Configuration &config =
132132
ObjectRegistry::getCurrentEngine()->getConfiguration();
133-
EventuallyPersistentEngine *epe =
134-
ObjectRegistry::onSwitchThread(NULL, true);
133+
NonBucketAllocationGuard guard;
135134
tmp = new ExecutorPool(config.getMaxThreads(),
136135
NUM_TASK_GROUPS,
137136
config.getNumReaderThreads(),
138137
config.getNumWriterThreads(),
139138
config.getNumAuxioThreads(),
140139
config.getNumNonioThreads());
141-
ObjectRegistry::onSwitchThread(epe);
142140
instance.store(tmp);
143141
}
144142
}
@@ -149,6 +147,7 @@ void ExecutorPool::shutdown(void) {
149147
std::lock_guard<std::mutex> lock(initGuard);
150148
auto* tmp = instance.load();
151149
if (tmp != nullptr) {
150+
NonBucketAllocationGuard guard;
152151
delete tmp;
153152
instance = nullptr;
154153
}

0 commit comments

Comments
 (0)