summaryrefslogtreecommitdiff
path: root/src/mongo/transport/service_executor_reserved.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/transport/service_executor_reserved.cpp')
-rw-r--r--src/mongo/transport/service_executor_reserved.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/mongo/transport/service_executor_reserved.cpp b/src/mongo/transport/service_executor_reserved.cpp
index d81ad5be200..cae9653e60f 100644
--- a/src/mongo/transport/service_executor_reserved.cpp
+++ b/src/mongo/transport/service_executor_reserved.cpp
@@ -33,13 +33,11 @@
#include "mongo/transport/service_executor_reserved.h"
-#include "mongo/db/server_options.h"
#include "mongo/logv2/log.h"
#include "mongo/stdx/thread.h"
#include "mongo/transport/service_executor_gen.h"
#include "mongo/transport/service_executor_utils.h"
#include "mongo/util/processinfo.h"
-#include "mongo/util/thread_safety_context.h"
namespace mongo {
namespace transport {
@@ -50,19 +48,6 @@ constexpr auto kExecutorLabel = "executor"_sd;
constexpr auto kExecutorName = "reserved"_sd;
constexpr auto kReadyThreads = "readyThreads"_sd;
constexpr auto kStartingThreads = "startingThreads"_sd;
-
-const auto getServiceExecutorReserved =
- ServiceContext::declareDecoration<std::unique_ptr<ServiceExecutorReserved>>();
-
-const auto serviceExecutorReservedRegisterer = ServiceContext::ConstructorActionRegisterer{
- "ServiceExecutorReserved", [](ServiceContext* ctx) {
- if (!serverGlobalParams.reservedAdminThreads) {
- return;
- }
-
- getServiceExecutorReserved(ctx) = std::make_unique<transport::ServiceExecutorReserved>(
- ctx, "admin/internal connections", serverGlobalParams.reservedAdminThreads);
- }};
} // namespace
thread_local std::deque<ServiceExecutor::Task> ServiceExecutorReserved::_localWorkQueue = {};
@@ -162,12 +147,6 @@ Status ServiceExecutorReserved::_startWorker() {
});
}
-ServiceExecutorReserved* ServiceExecutorReserved::get(ServiceContext* ctx) {
- auto& ref = getServiceExecutorReserved(ctx);
-
- // The ServiceExecutorReserved could be absent, so nullptr is okay.
- return ref.get();
-}
Status ServiceExecutorReserved::shutdown(Milliseconds timeout) {
LOGV2_DEBUG(22980, 3, "Shutting down reserved executor");
@@ -194,8 +173,8 @@ Status ServiceExecutorReserved::scheduleTask(Task task, ScheduleFlags flags) {
if (!_localWorkQueue.empty()) {
// Execute task directly (recurse) if allowed by the caller as it produced better
// performance in testing. Try to limit the amount of recursion so we don't blow up the
- // stack, even though this shouldn't happen with this executor that uses blocking
- // network I/O.
+ // stack, even though this shouldn't happen with this executor that uses blocking network
+ // I/O.
if ((flags & ScheduleFlags::kMayRecurse) &&
(_localRecursionDepth < reservedServiceExecutorRecursionLimit.loadRelaxed())) {
++_localRecursionDepth;