-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TESTS: Add a global fixture for folly::IOThreadPoolExecutor
Currently with centos7 we're having faults with thread_local when folly executors are created and destroyed with facebook/folly#1252 & possibly facebook/folly#1135, these issues don't seem to be reproducible in newer gcc's shipped with centos8+. Since in the EOS Code we create the executors and keep them around until shutdown, use a similar pattern instead of creating and destroying multiple folly threadpools Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
- Loading branch information
1 parent
42d2f3c
commit 160c12d
Showing
3 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// ---------------------------------------------------------------------- | ||
// File: FollyExecutorFixture.hh | ||
// Author: Abhishek Lekshmanan - CERN | ||
// ---------------------------------------------------------------------- | ||
|
||
/************************************************************************ | ||
* EOS - the CERN Disk Storage System * | ||
* Copyright (C) 2022 CERN/Switzerland * | ||
* * | ||
* This program is free software: you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation, either version 3 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>.* | ||
************************************************************************/ | ||
|
||
|
||
#pragma once | ||
|
||
#include <folly/executors/IOThreadPoolExecutor.h> | ||
#include <gtest/gtest.h> | ||
|
||
class FollyExecutor_F : public ::testing::Test { | ||
protected: | ||
void SetUp() override { | ||
folly_executor = std::make_shared<folly::IOThreadPoolExecutor>(kNumThreads); | ||
} | ||
|
||
void TearDown() override { | ||
folly_executor.reset(); | ||
} | ||
|
||
std::shared_ptr<folly::IOThreadPoolExecutor> folly_executor; | ||
constexpr static size_t kNumThreads = 4; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters